CustomTextField class

A TextFormField with a single TextInputFormatter. Utilizing hasError to show errorText.

Inheritance

Constructors

CustomTextField({Key? key, String? autofillHint, bool autofocus = false, TextEditingController? controller, String? errorText, FocusNode? focusNode, bool hasError = false, Widget? help, String? hintText, String? initialValue, TextInputFormatter? inputFormatter, TextInputType? keyboardType, String? labelText, int? maxLines = 1, int? minLines, bool obscureText = false, ValueChanged<String>? onChanged, VoidCallback? onEditingComplete, Widget? prefixIcon, EdgeInsets scrollPadding = const EdgeInsets.all(20.0), TextStyle? style, Widget? suffixIcon, TextCapitalization textCapitalization = TextCapitalization.none, TextInputAction? textInputAction})
A TextFormField with a single TextInputFormatter. Utilizing hasError to show errorText.
const

Properties

autofillHint String?
Determines what the input field expects.
final
autofocus bool
Determines whether to auto focus this input.
final
controller TextEditingController?
Controls the text being edited.
final
errorText String?
The text shown when there is an error.
final
focusNode FocusNode?
Used to obtain the keyboard focus and to handle keyboard events.
final
hasError bool
Determines if an error should be displayed.
final
hashCode int
The hash code for this object.
no setterinherited
help Widget?
If given, shows a suffix icon and dialog with this widget.
final
hintText String?
Text that suggests what sort of input the field accepts.
final
initialValue String?
The initial value of this input.
final
inputFormatter TextInputFormatter?
Provides as-you-type validation and formatting of the text being edited.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardType TextInputType?
The type of information for which to optimize the text input control.
final
labelText String?
An optional label for this input.
final
maxLines int?
The maximum number of lines for this input.
final
minLines int?
The minimum number of lines for this input.
final
obscureText bool
Determines whether to obscure the text in this input.
final
onChanged ValueChanged<String>?
Called when the value of the input changes.
final
onEditingComplete VoidCallback?
Called when the user submits editable content (e.g., user presses the "done" button on the keyboard).
final
prefixIcon Widget?
An icon that appers before the editable part of the text field.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollPadding EdgeInsets
Configures padding when the input scrolls into view.
final
style TextStyle?
The style to use for the text being edited.
final
suffixIcon Widget?
An icon that appers after the editable part of the text field.
final
textCapitalization TextCapitalization
Determines whether to show an uppercase or lowercase keyboard.
final
textInputAction TextInputAction?
An action the user has requested the text input control to perform.
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}) 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