loadTokenToCache<T extends Token> method

Future<T?> loadTokenToCache<T extends Token>()

Implementation

Future<T?> loadTokenToCache<T extends Token>() async {
  var json = await _secureStorage.read(key: _identifier);
  if (json == null) return null;
  try {
    var data = Convert.jsonDecode(json);
    return _getTokenFromMap<T>(data) as FutureOr<T?>;
  } catch (exception) {
    print(exception);
    return null;
  }
}