RepeaterFieldWidget class
repeater. One card per row, built by walking RepeaterComponent.children
— the item template, published once and walked once per row in the
value, never re-parsed per row.
Row values live in the form state as a genuine List<Map> under this
field's own name. Editing a child field in one row replaces only that
row's map inside a freshly-built list — every other row's map is the same
object it was before — so a flat-state bug that lets two rows share one
value cannot hide here: row 1 changing would mean row 1's map itself
changed, and it never does from an edit inside row 2.
component.readOnly (the server's own rule) or state.enabled == false
(a host or closure-driven gate) renders every row inert with no Add or
Remove control — the same "server's word wins" rule FileFieldWidget
follows for a picker the host did supply.
Per-row errors reuse the form's existing flat error map rather than a new
channel: client_validator.dart keys a required child empty in row 2 as
'<name>.1.<child>', the same shape a server 422 uses for
items.0.name, and this widget reads it out of FieldState.errors —
never a generic message for the whole field.
Nested repeaters are out of scope: a repeater inside a repeater's
template renders through this same widget recursively, and the walker
publishes a nested one readOnly: true — so there is no special case
here beyond honouring that flag like any other. (Until P6c's close-out
nothing published it: a nested repeater arrived editable, and its 422
came back keyed outer.0.inner.1.x, which this widget has no field to
render against — a form that could not be submitted and could not say
why. The server publishes the flag now; this docblock describes what
ships.)
registry is the host's own — the same registry that built this widget — so a host-registered field type, or a host override of a built-in one, renders inside a row exactly as it does everywhere else on the form. Null falls back to the defaults, for a caller constructing this widget directly rather than through FieldRegistry.build.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- RepeaterFieldWidget
Constructors
- RepeaterFieldWidget({required RepeaterComponent component, required FieldState state, FieldRegistry? registry, Key? key})
-
const
Properties
- component → RepeaterComponent
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- registry → FieldRegistry?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → FieldState
-
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited