ArcaneFieldProvider<T> class
abstract
The abstract base class for form field providers in the Arcane form system, managing reactive state with a BehaviorSubject<T>.
This class defines the interface for getting and setting form values, with built-in error handling via defaultValue and
reactive broadcasting for UI updates. It serves as the foundation for ArcaneField and FieldNode integrations in ArcaneForm,
enabling dynamic validation, nested structures, and custom storage backends. Subclasses like ArcaneFieldMapProvider and
ArcaneFieldDirectProvider implement the abstract onGetValue and onSetValue for specific persistence needs.
- Implementers
Constructors
- ArcaneFieldProvider({required T defaultValue})
Properties
- defaultValue → T
-
The default value used as a fallback when value retrieval fails (e.g., key not found or error in onGetValue).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
subject
↔ BehaviorSubject<
T> -
The reactive BehaviorSubject<T> that broadcasts current field values to listeners, enabling real-time UI updates.
getter/setter pair
Methods
-
getValue(
String k) → Future< T> - Asynchronously retrieves the value for the given key, falling back to defaultValue on any error from onGetValue.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onGetValue(
String k) → Future< T> - Abstract method to be implemented by subclasses for asynchronously retrieving the value associated with a key.
-
onSetValue(
String k, T value) → Future< void> - Abstract method to be implemented by subclasses for asynchronously setting the value for a key.
-
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.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited