setUser method

Future<void> setUser(
  1. User user
)

Saves the user data to local storage. If you use the signUp or signIn methods of this client library, you do not need to call this method to set the user data, since the client library automatically manages user data.

However, if you have not used the signUp or signIn methods of this client library, this method enables you to update locally stored user data

Implementation

Future<void> setUser(User user) async {
  if (_localStorage != null) {
    await _localStorage!.setItem('user', json.encode(user.toJson()));
  }
  _fetcher._setUser(user);
}