PrfAdapterMap class
Registry for managing adapters that convert between Dart types and SharedPreferences.
The adapter map maintains a registry of PrfAdapter instances for different types, allowing the PRF library to automatically select the appropriate adapter for each type. It comes with built-in adapters for common types and can be extended with custom adapters.
Constructors
- PrfAdapterMap.new()
- Creates a new adapter registry.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- registered ↔ bool
-
Whether any adapters have been registered yet.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
contains<
T> () → bool -
Checks if an adapter for type
T
has been registered. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
of<
T> () → PrfAdapter< T> -
Retrieves the adapter for type
T
. -
register<
T> (PrfAdapter< T> adapter, {bool override = false}) → void -
Registers an adapter for type
T
. -
registerAdapters(
) → void - Registers all standard adapters for primitive and common types.
-
registerAll(
) → void - Registers all standard adapters if none have been registered yet.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ PrfAdapterMap
-
Singleton instance of the adapter registry.
getter/setter pair