TextSuperFormField class
Regular material TextField that extends SuperFormField
This widget's state automatically registers field for name so there is no need for manual registration.
Specify rules to add validation for this field. Errors will be displayed automatically as errorText of InputDecoration. Overriding this property will hide errors from validation.
Most fields are kept the same as in TextField so see there for documentation of specific properties.
TextSuperFormField(
decoration: InputDecoration(
labelText: "Password",
prefixIcon: Icon(Icons.lock),
),
obscureText: true,
name: "password",
rules: [
Required("Must not be empty"),
MinimumLengthRule(
6,
"Must be at least 6 characters",
),
],
)
See also:
- TextField, which is non-connected version of this widget
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- SuperFormField
- TextSuperFormField
Constructors
-
TextSuperFormField({Key? key, required String name, List<
SuperFormFieldRule> ? rules, InputDecoration? decoration = const InputDecoration(), TextInputType? keyboardType, TextCapitalization textCapitalization = TextCapitalization.none, TextInputAction? textInputAction, TextStyle? style, StrutStyle? strutStyle, TextDirection? textDirection, TextAlign textAlign = TextAlign.start, TextAlignVertical? textAlignVertical, bool autofocus = false, bool readOnly = false, ToolbarOptions? toolbarOptions, bool? showCursor, String obscuringCharacter = '•', bool obscureText = false, bool autocorrect = true, SmartDashesType? smartDashesType, SmartQuotesType? smartQuotesType, bool enableSuggestions = true, MaxLengthEnforcement? maxLengthEnforcement, int? maxLines = 1, int? minLines, bool expands = false, int? maxLength, ValueChanged<String> ? onChanged, GestureTapCallback? onTap, VoidCallback? onEditingComplete, ValueChanged<String> ? onFieldSubmitted, List<TextInputFormatter> ? inputFormatters, bool? enabled, double cursorWidth = 2.0, double? cursorHeight, Radius? cursorRadius, Color? cursorColor, Brightness? keyboardAppearance, EdgeInsets scrollPadding = const EdgeInsets.all(20.0), bool enableInteractiveSelection = true, TextSelectionControls? selectionControls, InputCounterWidgetBuilder? buildCounter, ScrollPhysics? scrollPhysics, Iterable<String> ? autofillHints, ScrollController? scrollController, Widget? noFormFallback, FocusNode? focusNode})
Properties
- builder → SuperFormFieldBuilder
-
finalinherited
- focusNode → FocusNode?
-
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- name → String
-
Name of the field
finalinherited
- noFormFallback → Widget
-
Fallback widget for a case where SuperForm ancestor is unavailable
finalinherited
-
rules
→ List<
SuperFormFieldRule> -
Field validation rules
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _TextSuperFormFieldState -
Creates the mutable state for this widget at a given location in the tree.
override
-
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}) → 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