provision static method

Future<Store> provision({
  1. required String uri,
  2. StoreKeyMethod? keyMethod,
  3. String? passKey,
  4. String? profile,
  5. required bool recreate,
})

Provisions a new store.

Throws an AskarStoreException if provisioning fails.

Implementation

static Future<Store> provision({
  required String uri,
  StoreKeyMethod? keyMethod,
  String? passKey,
  String? profile,
  required bool recreate,
}) async {
  try {
    final storeHandle =
        (await askarStoreProvision(
          uri,
          recreate: recreate,
          keyMethod: keyMethod,
          passKey: passKey,
          profile: profile,
        )).getValueOrException();

    return Store(storeHandle, uri);
  } catch (e) {
    throw AskarStoreException('Error on store provision: $e');
  }
}