FormValues class
A form's in-progress values.
Runtime-shaped like ResourceRecord: the schema is only known at runtime,
so this is a typed wrapper over a map rather than a generated model. It is
immutable — set returns a new instance — so a provider's
notifyListeners() always corresponds to a genuinely new object and a
widget comparing old to new sees a difference.
Constructors
-
FormValues.initial(List<
SchemaComponent> components, {Map<String, dynamic> from = const {}}) -
Seeds one value per named field in
components:from(a record being edited) wins when it holds the key — including an explicitnull, which is a value the user deliberately cleared — and a component's owndefaultfills the gap only whenfromhas no entry at all.factory
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
payloadFor(
List< SchemaComponent> components) → Map<String, dynamic> -
Builds a submission payload from the schema's declared field names, not
from
_values's keys — the client-side mirror of the server's "no rule, no validated key, no write". A key the schema does not declare, however it got into the value map, can never reach the server this way. -
set(
String name, Object? value) → FormValues - Over-eager on purpose: setting a field back to its initial value still marks it dirty rather than diffing against the seed. An extra field in the payload is cheap; silently dropping a real edit is not.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
String name) → Object?