deleteAllKey method

Future<void> deleteAllKey()

Implementation

Future<void> deleteAllKey() async {
  var response =
      await AtLocationNotificationListener().atClientInstance!.getKeys(
            regex: '',
          );
  await Future.forEach(response, (dynamic key) async {
    if (!'@$key'.contains('cached')) {
      // the keys i have created
      var atKey = getAtKey(key);
      var result = await AtLocationNotificationListener()
          .atClientInstance!
          .delete(atKey, isDedicated: MixedConstants.isDedicated);
      print('$key is deleted ? $result');
    }
  });

  if (MixedConstants.isDedicated) {
    await SyncSecondary().callSyncSecondary(SyncOperation.syncSecondary);
  }
}