Back

Implement login feature

  • 0
  • Flutter
  • REST API
rosario
12 Mar, 2024, 12:52

Hi guys,

I have an issue, I hope you can help me.

I am trying to implement a login for my Flutter web app.

I want to implement that if the user closes the browser or reloads the page the Flutter app searches for the session id, which was saved in the local storage of the browser. With the session id I can get the user id which I use to retrieve the user object. In that way, I repopulate the data in the classes and the pages without having the user log in again.

My issue is that to retrieve a user by user id I need to use the Dart SDK. The user object of the Dart SDK is different from the Flutter SDK.

I could retrieve the user by using account.get() from the Flutter SDK, but all classes and objects are rebuilt when I refresh the page in the browser so the object will be null.

Do you have a workaroud for the issue?

TL;DR
Issue: Implementing a login feature in a Flutter web app where user data needs to be repopulated upon browser reload. Solution: To workaround the issue of Flutter objects being null on browser refresh, developers can avoid relying solely on Flutter SDK for user data retrieval by considering using the Dart SDK which may offer a more compatible way to fetch user objects.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more