ZeroTextField class

ZeroTextField is the the simplified version of TextField with the default implemented design guidelines of Zero One Design System. Pretty much all the fields are inheritted from TextField except that it provides labelText, hintText, errorText, and supportText upfront instead of under InputDecoration.

There are 4 variants represented as 4 factory constructors:

  1. ZeroTextField.outline which uses OutlineInputBorder under the hood.
  2. ZeroTextField.filled which uses UnderlineInputBorder under the hood with fillColor provided.
  3. ZeroTextField.underline which uses UnderlineInputBorder under the hood.
Inheritance
Implementers

Constructors

ZeroTextField.new({Key? key, String? hintText, String? helperText, String? labelText, String? errorText, TextStyle? labelStyle, TextStyle? errorStyle, TextStyle? helperStyle, InputDecorationType? inputDecorationType, ZeroTextfieldSize textfieldSize = ZeroTextfieldSize.small, Widget? prefixIcon, Widget? suffixIcon, Widget? prefix, Widget? suffix, InputDecoration? decoration, AutovalidateMode? autovalidateMode = AutovalidateMode.onUserInteraction, bool? enabled, dynamic onChanged(String)?, dynamic onEditingComplete()?, TextEditingController? controller, FocusNode? focusNode, TextInputType? keyboardType, String? validator(String?)?, TextInputAction? textInputAction = TextInputAction.next, int? minLines, int? maxLines, TextAlignVertical? textAlignVertical, bool? autofocus = false, void onFieldSubmitted(String text)?, void onSaved(String? text)?, dynamic onTap()?, dynamic onTapOutside(PointerDownEvent event)?, OnFocusChanged? onFocusChanged, bool autocorrect = false, Iterable<String>? autofillHints, TextStyle? style, String? initialValue, bool expands = false, List<TextInputFormatter>? inputFormatters, TextCapitalization textCapitalization = TextCapitalization.none, Brightness? keyboardAppearance, bool obscureText = false, bool readOnly = false, Color? cursorColor, double? cursorHeight, double cursorWidth = 2.0, Radius? cursorRadius, bool enableSuggestion = false, BuildCounter? buildCounter, ContextMenuBuilder? contextMenuBuilder, int? maxLength, MouseCursor? mouseCursor, MaxLengthEnforcement? maxLengthEnforcement, String obscuringCharacter = '•', ScrollController? scrollController, EdgeInsets scrollPadding = const EdgeInsets.all(20.0), bool showCursor = true, ScrollPhysics? scrollPhysics, StrutStyle? strutStyle, TextAlign textAlign = TextAlign.start, TextDirection? textDirection, TextSelectionControls? selectionControls, bool enableIMEPersonalizedLearning = true, bool? enableInteractiveSelection})
const
ZeroTextField.filled({Key? key, String? hintText, String? labelText, ZeroTextfieldSize? textfielSizeType, TextEditingController? controller, FocusNode? focusNode, TextInputType? inputType, dynamic onChanged(String)?, dynamic onEditingComplete()?, String? validator(String?)?, AutovalidateMode? autovalidateMode, Widget? prefixIcon, Widget? suffixIcon, Widget? prefix, Widget? suffix, InputDecoration? decoration, String? errorText, String? helperText, bool? enabled, bool? autofocus, void onFieldSubmitted(String text)?, void onSaved(String? text)?, void onTap()?, void onTapOutside(PointerDownEvent event)?, OnFocusChanged? onFocusChanged, bool? autocorrect, Iterable<String>? autofillHints, BuildCounter? buildCounter, ContextMenuBuilder? contextMenuBuilder, Color? cursorColor, double? cursorHeight, Radius? cursorRadius, double? cursorWidth, bool? enableIMEPersonalizedLearning, bool? enableInteractiveSelection, bool? enableSuggestion, TextStyle? errorStyle, TextStyle? helperStyle, TextStyle? labelStyle, int? maxLength, bool? expands, String? initialValue, List<TextInputFormatter>? inputFormatters, Brightness? keyboardAppearance, MaxLengthEnforcement? maxLengthEnforcement, int? maxLines, int? minLines, MouseCursor? mouseCursor, bool? obscureText, String? obscuringCharacter, bool? readOnly, ScrollController? scrollController, EdgeInsets? scrollPadding, ScrollPhysics? scrollPhysics, TextSelectionControls? selectionControls, bool? showCursor, StrutStyle? strutStyle, TextStyle? style, TextAlign? textAlign, TextAlignVertical? textAlignVertical, TextCapitalization? textCapitalization, TextDirection? textDirection, TextInputAction? textInputAction})
This already uses UnderlineInputBorder under the hood with fillColor set as per defined in the standard ZeroOne design guideline.
factory
ZeroTextField.outline({Key? key, String? hintText, String? labelText, ZeroTextfieldSize? textfielSizeType, TextEditingController? controller, FocusNode? focusNode, TextInputType? inputType, dynamic onChanged(String)?, dynamic onEditingComplete()?, String? validator(String?)?, Widget? prefixIcon, Widget? suffixIcon, Widget? prefix, Widget? suffix, AutovalidateMode? autovalidateMode, InputDecoration? decoration, String? helperText, String? errorText, bool? enabled, bool? autofocus, void onFieldSubmitted(String text)?, void onSaved(String? text)?, void onTap()?, void onTapOutside(PointerDownEvent event)?, OnFocusChanged? onFocusChanged, bool? autocorrect, Iterable<String>? autofillHints, BuildCounter? buildCounter, ContextMenuBuilder? contextMenuBuilder, Color? cursorColor, double? cursorHeight, Radius? cursorRadius, double? cursorWidth, bool? enableIMEPersonalizedLearning, bool? enableInteractiveSelection, bool? enableSuggestion, TextStyle? errorStyle, TextStyle? helperStyle, TextStyle? labelStyle, int? maxLength, bool? expands, String? initialValue, List<TextInputFormatter>? inputFormatters, Brightness? keyboardAppearance, MaxLengthEnforcement? maxLengthEnforcement, int? maxLines, int? minLines, MouseCursor? mouseCursor, bool? obscureText, String? obscuringCharacter, bool? readOnly, ScrollController? scrollController, EdgeInsets? scrollPadding, ScrollPhysics? scrollPhysics, TextSelectionControls? selectionControls, bool? showCursor, StrutStyle? strutStyle, TextStyle? style, TextAlign? textAlign, TextAlignVertical? textAlignVertical, TextCapitalization? textCapitalization, TextDirection? textDirection, TextInputAction? textInputAction})
This already uses OutlineInputBorder under the hood with the properties defined in the standard ZeroOne design guideline.
factory
ZeroTextField.rounded({Key? key, String? hintText, String? labelText, ZeroTextfieldSize? textfielSizeType, TextEditingController? controller, FocusNode? focusNode, TextInputType? inputType, dynamic onChanged(String)?, dynamic onEditingComplete()?, String? validator(String?)?, Widget? prefixIcon, Widget? suffixIcon, Widget? prefix, Widget? suffix, AutovalidateMode? autovalidateMode, InputDecoration? decoration, String? helperText, String? errorText, bool? enabled, bool? autofocus, void onFieldSubmitted(String text)?, void onSaved(String? text)?, void onTap()?, void onTapOutside(PointerDownEvent event)?, OnFocusChanged? onFocusChanged, bool? autocorrect, Iterable<String>? autofillHints, BuildCounter? buildCounter, ContextMenuBuilder? contextMenuBuilder, Color? cursorColor, double? cursorHeight, Radius? cursorRadius, double? cursorWidth, bool? enableIMEPersonalizedLearning, bool? enableInteractiveSelection, bool? enableSuggestion, TextStyle? errorStyle, TextStyle? helperStyle, TextStyle? labelStyle, int? maxLength, bool? expands, String? initialValue, List<TextInputFormatter>? inputFormatters, Brightness? keyboardAppearance, MaxLengthEnforcement? maxLengthEnforcement, int? maxLines, int? minLines, MouseCursor? mouseCursor, bool? obscureText, String? obscuringCharacter, bool? readOnly, ScrollController? scrollController, EdgeInsets? scrollPadding, ScrollPhysics? scrollPhysics, TextSelectionControls? selectionControls, bool? showCursor, StrutStyle? strutStyle, TextStyle? style, TextAlign? textAlign, TextAlignVertical? textAlignVertical, TextCapitalization? textCapitalization, TextDirection? textDirection, TextInputAction? textInputAction})
This already uses OutlineInputBorder under the hood with borderRadius set so much so that it shapes rounded.
factory
ZeroTextField.underline({Key? key, String? hintText, String? labelText, ZeroTextfieldSize? textfielSizeType, TextEditingController? controller, FocusNode? focusNode, TextInputType? inputType, dynamic onChanged(String)?, dynamic onEditingComplete()?, String? validator(String?)?, AutovalidateMode? autovalidateMode, Widget? prefixIcon, Widget? suffixIcon, Widget? prefix, Widget? suffix, InputDecoration? decoration, String? helperText, String? errorText, bool? enabled, bool? autofocus, void onFieldSubmitted(String text)?, void onSaved(String? text)?, void onTap()?, void onTapOutside(PointerDownEvent event)?, OnFocusChanged? onFocusChanged, bool? autocorrect, Iterable<String>? autofillHints, BuildCounter? buildCounter, ContextMenuBuilder? contextMenuBuilder, Color? cursorColor, double? cursorHeight, Radius? cursorRadius, double? cursorWidth, bool? enableIMEPersonalizedLearning, bool? enableInteractiveSelection, bool? enableSuggestion, TextStyle? errorStyle, TextStyle? helperStyle, TextStyle? labelStyle, int? maxLength, bool? expands, String? initialValue, List<TextInputFormatter>? inputFormatters, Brightness? keyboardAppearance, MaxLengthEnforcement? maxLengthEnforcement, int? maxLines, int? minLines, MouseCursor? mouseCursor, bool? obscureText, String? obscuringCharacter, bool? readOnly, ScrollController? scrollController, EdgeInsets? scrollPadding, ScrollPhysics? scrollPhysics, TextSelectionControls? selectionControls, bool? showCursor, StrutStyle? strutStyle, TextStyle? style, TextAlign? textAlign, TextAlignVertical? textAlignVertical, TextCapitalization? textCapitalization, TextDirection? textDirection, TextInputAction? textInputAction})
This already uses UnderlineInputBorder under the hood with fillColor set as per defined in the standard ZeroOne design guideline.
factory

Properties

autocorrect bool
final
autofillHints Iterable<String>?
final
autofocus bool?
final
autovalidateMode AutovalidateMode?
final
buildCounter BuildCounter?
final
contextMenuBuilder ContextMenuBuilder?
final
controller TextEditingController?
final
cursorColor Color?
final
cursorHeight double?
final
cursorRadius Radius?
final
cursorWidth double
final
decoration InputDecoration?
final
enabled bool?
final
enableIMEPersonalizedLearning bool
final
enableInteractiveSelection bool?
final
enableSuggestion bool
final
errorStyle TextStyle?
final
errorText String?
final
expands bool
final
focusNode FocusNode?
final
hashCode int
The hash code for this object.
no setterinherited
helperStyle TextStyle?
final
helperText String?
final
hintText String?
final
initialValue String?
final
inputDecorationType InputDecorationType?
Values: inputDecorationType.outline, inputDecorationType.underline, and inputDecorationType.fill This affects how the widget renders OutlineInputBorder in terms of fill color, border colors, and fill color
final
inputFormatters List<TextInputFormatter>?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardAppearance Brightness?
final
keyboardType TextInputType?
final
labelStyle TextStyle?
final
labelText String?
final
maxLength int?
final
maxLengthEnforcement MaxLengthEnforcement?
final
maxLines int?
final
minLines int?
final
mouseCursor MouseCursor?
final
obscureText bool
final
obscuringCharacter String
final
onChanged → dynamic Function(String)?
final
onEditingComplete → dynamic Function()?
final
onFieldSubmitted → void Function(String text)?
final
onFocusChanged OnFocusChanged?
final
onSaved → void Function(String? text)?
final
onTap → dynamic Function()?
final
onTapOutside → dynamic Function(PointerDownEvent event)?
final
prefix Widget?
If set, this will override prefix that is defined in InputDecoration
final
prefixIcon Widget?
If set, this will override prefixIcon that is defined in InputDecoration
final
readOnly bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollController ScrollController?
final
scrollPadding EdgeInsets
final
scrollPhysics ScrollPhysics?
final
selectionControls TextSelectionControls?
final
showCursor bool
final
strutStyle StrutStyle?
final
style TextStyle?
final
suffix Widget?
If set, this will override suffix that is defined in InputDecoration
final
suffixIcon Widget?
If set, this will override suffixIcon that is defined in InputDecoration
final
textAlign TextAlign
final
textAlignVertical TextAlignVertical?
final
textCapitalization TextCapitalization
final
textDirection TextDirection?
final
textfieldSize ZeroTextfieldSize
TextField's size; large or small. Default value: ZeroTextfieldSize.small
final
textInputAction TextInputAction?
final
validator String? Function(String?)?
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<ZeroTextField>
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, 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