save method Null safety

Future<void> save()

Implementation

Future<void> save() async {
  await _storage.write(
      key: _AUTHENTICATION_TOKEN_KEY, value: this.accessToken);

  await _storage.write(key: _ID_TOKEN_KEY, value: this.idToken);
  await this.refreshToken == null
      ? _storage.delete(key: _REFRESH_TOKEN_KEY)
      : _storage.write(key: _REFRESH_TOKEN_KEY, value: this.refreshToken);

  await _storage.write(key: _TOKEN_TYPE_KEY, value: this.tokenType);
  await _storage.write(
      key: _EXPIRES_ON_KEY,
      value: this.expiresAt.millisecondsSinceEpoch.toString());
  await this.state == null
      ? _storage.delete(key: _STATE_KEY)
      : _storage.write(key: _STATE_KEY, value: this.state);
}