fromStore static method

Future<User?> fromStore()

creates a new User from variables stored on device

Implementation

static Future<User?> fromStore() async {
  String? name = await _storage.read(key: _username_store);
  String? pass = await _storage.read(key: _userpass_store);
  if (name == null || pass == null) return null;
  var _user = User(name, pass);
  _user.full_name = (await _prefs).getString(_full_name_store);
  _user.full_surname = (await _prefs).getString(_full_surname_store);
  return _user;
}