get method

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

Gets a CacheObject by key

Implementation

@override
Future<CacheObject?> get(String key) async {
  final List<Map<dynamic, dynamic>> maps = await db!.query(_tableCacheObject,
      columns: null, where: '${CacheObject.columnKey} = ?', whereArgs: [key]);
  if (maps.isNotEmpty) {
    return CacheObject.fromMap(maps.first.cast<String, dynamic>());
  }
  return null;
}