HiveManager class
A manager class responsible for initializing and tearing down Hive, a local database for Flutter.
The HiveManager
class provides methods to initialize Hive with
necessary adapters and open boxes for various models used throughout the
application. It also provides a method to close all opened Hive boxes
when they are no longer needed.
Constructors
:
Properties
[hashCode] [→ int] : The hash code for this object. ::: features no setterinherited :::
[runtimeType] [→ Type] : A representation of the runtime type of the object. ::: features no setterinherited :::
Methods
[noSuchMethod][([[Invocation] invocation]) → dynamic ] : Invoked when a nonexistent method or property is accessed. ::: features inherited :::
[toString][ [→ String] ] : A string representation of this object. ::: features inherited :::
Operators
[operator ==][([[Object] other]) [→ bool] ] : The equality operator. ::: features inherited :::
Static Methods
[closeBox]<[T>][([[String] boxName]) [→ Future<[void>]] ]
: Closes the boxName
named box.
[initializeHive][ [→ Future<[void>]] ] : Initializes Hive with the specified directory.
[openBox]<[T>][([[String] boxName]) [→ Future<[void>]] ]
: Opens the boxName
named box.
[registerAdapter]<[T>][([[TypeAdapter<[T>]] adapter]) [→ Future<[void>]] ]
: Registers the adapter
named adapter.
[registerAdapters][ [→ Future<[void>]] ] : Registers the necessary Hive adapters for the models used in the application.
[teardownHive][ [→ Future<[void>]] ] : Closes all opened Hive boxes and the Hive instance itself.
- talawa
- hive_manager
- HiveManager class