getCacheData method

Future<APICacheDBModel> getCacheData(
  1. String key
)

Implementation

Future<APICacheDBModel> getCacheData(String key) async {
  await APICacheDBHelper.init();

  List<Map<String, dynamic>> cacheData =
      await APICacheDBHelper.conditionalQuery(
    APICacheDBModel.table,
    "key = ?",
    key,
  );

  return cacheData.map((item) => APICacheDBModel.fromMap(item)).first;
}