Skip to content

Instantly share code, notes, and snippets.

@ookami-kb
Created June 15, 2020 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ookami-kb/6dad9b43b2c96f3417c6f24655921d81 to your computer and use it in GitHub Desktop.
Save ookami-kb/6dad9b43b2c96f3417c6f24655921d81 to your computer and use it in GitHub Desktop.
class SharedPrefTokenRepository implements TokenRepository {
@override
Future<void> save(String token) async =>
(await SharedPreferences.getInstance()).setString(_keyToken, token);
@override
Future<String> load() async =>
(await SharedPreferences.getInstance()).getString(_keyToken);
static const String _keyToken = 'token';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment