getData method

  1. @override
Future<String?> getData(
  1. String key
)
override

get stored data from local database.

checks if the data was cached and returns the cached data if its not expired, otherwise it returns null

key - the key used to store the data

Implementation

@override
Future<String?> getData(String key) async {
  if (!isInitialized) await init();

  return _prefs?.getString(key);
}