BaseFormEntity<F extends BaseFormEntity<F, E> , E extends Enum> class
abstract
A base class for immutable form entities used by the FormBloc system.
This class enforces a consistent way to update form fields using enum keys, enabling generic form handling, validation, and UI updates. Subclasses must implement both updateByKey and getValueByKey to define how individual fields are stored and updated.
Type parameters:
Fis the concrete subclass type (F-bound polymorphism), allowing methods like updateByKey to return a strongly typed instance.Eis the enum type representing the unique keys of the form fields.
- Inheritance
-
- Object
- BaseEntity
- BaseFormEntity
Constructors
- BaseFormEntity()
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- identifier → String
-
A globally unique and constant identifier for the entity.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getFormattedValueByKey(
E key) → dynamic -
getFormattedValueIfNotNullOtherwiseValue(
E key) → dynamic -
getValueByKey(
E key) → dynamic -
Retrieves the value associated with the given field
key. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateByKey(
E key, dynamic value) → F -
Updates the field corresponding to the given
keyand returns a new instance of the form entity. -
updateByKeySafe(
E key, dynamic value) → F - A safe version of updateByKey that performs a debug-mode consistency check.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited