createProfile method

Future<void> createProfile({
  1. String? name,
})

Creates a new profile in the store.

Throws an AskarStoreException if the profile creation fails. Returns the name of the profile, which is automatically generated if not provided.

Implementation

Future<void> createProfile({String? name}) async {
  try {
    (await askarStoreCreateProfile(handle, profile: name)).throwOnError();
  } catch (e) {
    throw AskarStoreException('Failed to create profile: $e');
  }
}