createBox<K, T> method

BoxInterface<K, T> createBox<K, T>(
  1. String name, {
  2. HiveCipher? encryptionCipher,
  3. bool crashRecovery = true,
  4. String? path,
  5. String? collection,
  6. LogHandler? logger,
})

Creates a BoxInterface for this BoxType and the given key/value types.

Example:

final box = BoxType.isolated.createBox<String, MyModel>('myBox');

Implementation

BoxInterface<K, T> createBox<K, T>(
  String name, {
  HiveCipher? encryptionCipher,
  bool crashRecovery = true,
  String? path,
  String? collection,
  LogHandler? logger,
}) =>
    BoxCreator.boxFromConfig<K, T>(
      boxConfig(
        name,
        encryptionCipher: encryptionCipher,
        crashRecovery: crashRecovery,
        path: path,
        collection: collection,
        logger: logger,
      ),
    );