Previous video:

🇺🇸 Profile (7/8)

Intro

We’re glad to see you’ve made it to this last course on user accounts, we hope you’ve been enjoying the videos so far.

To finish this training, we’ll be discussing avatars today. Let’s go!

Content of the video

Choosing an avatar ( - ) Verification of the app ( - )

Transcript

1. Choosing an avatar

Hello. In this new video, I'm going to talk about avatar management. For the avatar, things are different because the images cannot be directly stored in a database. You will have to go and get the image from your computer or phone. Then it must be uploaded to the database through Supabase Storage. This element allows to store the files. Then we need to connect this avatar to the profile itself.

To do this, I'm going to modify the graph of the image. When I click on it I will open the file selection with a control block. By clicking on this block, the application will retrieve the file and do something with it. I configure the type of file to recover.

Only images can be recovered. Then I test the success with a condition block. In case of failure, I set errorProfilemessage while connecting it to the file selection error.

On success, I set this variable to no value. Now that I've done that, I need to upload the image to supabase.

Thanks to Supabase Storage, this is quite easy. You'll recall that in the parent nodes of our screens, I put supabase nodes like "auth", "data" and "storage". Storage will provide methods to manipulate the files in Supabase.