FlutterPersistence class abstract

An abstract class providing utility methods for persisting and retrieving data using Hive as a local storage solution in Flutter applications.

Constructors

FlutterPersistence.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

clearAll() Future<void>
Clears all data stored by Hive.
clearBox([String? boxName]) Future<void>
Clears the data stored in a specific Hive box.
clearKey(String key, [String? boxName]) Future<void>
Clears data associated with a specific key in a Hive box.
future<T>({required String key, required Future<T> future, String? boxName, bool waitForConnection = false}) Stream<FlutterPersistenceResponse<T>>
Retrieves and caches data from a specified key in a Hive box based on the provided future.
init([String? boxName]) Future<void>
Initializes Hive for Flutter and opens a storage box for data storage.
stream<T>({required String key, required Stream<T> stream, String? boxName, bool waitForConnection = false}) Stream<FlutterPersistenceResponse<T>>
Streams data from a specified key in a Hive box based on the provided stream.