getData method
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<dynamic> getData(String key) async =>
(await _read(key))?['data'] as String?;