storeCredentials method Null safety
- AppleAuthCredentials credentials
Stores the credentials when first received.
Implementation
Future<AppleAuthCredentials> storeCredentials(
AppleAuthCredentials credentials) async {
var storedCredentials = await _storage.get();
if (storedCredentials == null ||
storedCredentials['email'] == null ||
storedCredentials['email'].isEmpty) {
await _storage.set(credentials.toJson());
storedCredentials = credentials.toJson();
}
return AppleAuthCredentials.fromJson(storedCredentials);
}