Best way of updating current userData

Actions & Logic

My app does not use Firebase but an external API either for authentication (custom authentication) as well as for application data.

After logging in I map user data to a FF defined user structure as suggested by the documentation.

I created a page where I open a bottom sheet to upload and change new profile picture using a sample component found within FlutterFlow (see image).

Everything works very nice as I am able to upload the picture locally, then sending it to server through a custom api call and showing the new uploaded picture in the bottom sheet.

What have you tried so far?

Now the problem: the new profile picture will regularly be available at the next login. However I would like to update it immediately for the user after closing the bottom sheet.

To do this I tried following methods:

  1. Updating, through a custom defined action, the field in the UserData structure

  2. Forcing a refreshToken API call

However I am under the impression that this I am over-engineering this simple task. What is in your opinion the best way to handle this task?

Did you check FlutterFlow's Documentation for this topic?
Yes
3
2 replies