Fluent2FormField class
Fluent 2's Field: its label (a Fluent2Label, or a Fluent2InfoLabel when info is given; the asterisk when required) 4 over the child control, then the validation line (validationMessage with its validationState's glyph: an error by default) and the helper in caption1 in the third ink, 2 apart. The control takes the field's label as its spoken name and, for an error, its red stroke. Fluent2FieldOrientation.horizontal stands the label in the start third. A single control (a text field, a select, a switch, a slider) takes the label, hint and validity into its own node; a child of several controls (a spin button's steppers round its entry, a radio group, a segmented control, toolbar toggles, tags) is named by the label as a group, each control keeping its own node a screen reader's tap reaches; the label is read once (mergeSemantics).
Fluent2FormField(label: 'Email', required: true, helper: 'We send the invite here.', child: Fluent2TextField(value: email, onChanged: (v) => setState(() => email = v)))
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- Fluent2FormField
Constructors
- Fluent2FormField({required Widget child, String? label, bool required = false, String? helper, String? validationMessage, Fluent2ValidationState? validationState, String? info, Fluent2FieldOrientation orientation = Fluent2FieldOrientation.vertical, Fluent2InputSize size = Fluent2InputSize.medium, bool? mergeSemantics, Key? key})
-
A form field:
labeloverchild, with its hint and validation under.const
Properties
- child → Widget
-
The control the field labels.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- helper → String?
-
A hint under the control; null shows none.
final
- info → String?
-
What the label's info button says; null draws a plain label.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String?
-
The label's words; null shows none.
final
- mergeSemantics → bool?
-
Whether the label, hint and validity join the control's own node:
true always (one node for the whole child), false never (the label
names the child as a group, each control keeping its node), null as
the child's controls say: one control is one node with the label,
several keep their own (the design kit's DesignField).
final
- orientation → Fluent2FieldOrientation
-
The label above the control, or before it.
final
- required → bool
-
Whether the field must be filled (a red asterisk follows its label).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → Fluent2InputSize
-
Fluent's
size: the label's type.final - validationMessage → String?
-
The validation message under the control; null shows none.
final
- validationState → Fluent2ValidationState?
-
Null is an error once there is a validationMessage, else none.
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.
override
-
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