get<T> method Null safety

Future<T> get<T>(
  1. String key
)

Implementation

Future<T> get<T>(String key) async {
  // Get SharedPreferences
  SharedPreferences refs = await SharedPreferences.getInstance();
  // Cast data type
  return refs.get(key) as T;
}