copyTo method

Future<StoreHandle> copyTo({
  1. required String uri,
  2. StoreKeyMethod? keyMethod,
  3. String? passKey,
  4. required bool recreate,
})

Copies the store contents to a new location.

Throws an AskarStoreException if copying the store fails.

Implementation

Future<StoreHandle> copyTo({
  required String uri,
  StoreKeyMethod? keyMethod,
  String? passKey,
  required bool recreate,
}) async {
  try {
    final result = await askarStoreCopy(handle, uri, keyMethod, passKey, recreate);
    return result.value;
  } catch (e) {
    throw AskarStoreException('Failed to copy: $e');
  }
}