isAPICacheKeyExist method

Future<bool> isAPICacheKeyExist(
  1. String key
)

Implementation

Future<bool> isAPICacheKeyExist(String key) async {
  await APICacheDBHelper.init();

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

  return cacheData.length == 1 ? true : false;
}