ArcaneFieldMapProvider<T> class
A concrete implementation of ArcaneFieldProvider that manages form field state using a nested Map<String, dynamic> for storage.
This provider supports hierarchical data access via dot notation (e.g., 'user.name.first'), making it suitable for complex form structures
in ArcaneForm where fields may be nested. It integrates seamlessly with ArcaneField and FieldNode from the form system,
providing reactive value updates through a BehaviorSubject. Key features include automatic creation of nested maps during value setting,
exception handling for missing keys during retrieval, and fallback to a default value on errors. Use this for in-memory form state management
without external dependencies, ensuring type-safe access to nested form data.
- Inheritance
-
- Object
- ArcaneFieldProvider<
T> - ArcaneFieldMapProvider
Constructors
-
ArcaneFieldMapProvider({required T defaultValue, required Map<
String, dynamic> storage}) - Constructs an ArcaneFieldMapProvider instance with the specified default value and storage map.
Properties
- defaultValue → T
-
The default value used as a fallback when value retrieval fails (e.g., key not found or error in onGetValue).
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
storage
→ Map<
String, dynamic> -
The nested storage map holding form field values, supporting dynamic key access with dot notation for hierarchy.
final
-
subject
↔ BehaviorSubject<
T> -
The reactive BehaviorSubject<T> that broadcasts current field values to listeners, enabling real-time UI updates.
getter/setter pairinherited
Methods
-
getValue(
String k) → Future< T> -
Asynchronously retrieves the value for the given key, falling back to defaultValue on any error from onGetValue.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onGetValue(
String k) → Future< T> -
Asynchronously retrieves the value associated with the given key from the nested storage map.
override
-
onSetValue(
String k, T value) → Future< void> -
Asynchronously sets the value for the given key in the nested storage map, creating intermediate maps if needed.
override
-
setValue(
String k, T value) → Future< void> -
Asynchronously sets the value for the given key using onSetValue, then emits the new value to the subject.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited