syncKeys method

dynamic syncKeys(
  1. dynamic keys
)

Sync keys to the backpack instance.

Implementation

syncKeys(keys) async {
  Future<List<Object?>> Function() keysToSync = await keys();
  List finalKeys = await keysToSync();
  for (var key in finalKeys) {
    if (key is Future Function(bool)) {
      await key(true);
      continue;
    }
    dynamic keyValue = await NyStorage.read(key);
    Backpack.instance.save(key, keyValue);
  }
}