InputField class

Nylo's Text Field Widget

Inheritance
Available extensions

Constructors

InputField({Key? key, required TextEditingController controller, String? labelText, bool obscureText = false, bool autoFocus = false, TextInputType keyboardType = TextInputType.text, TextAlign? textAlign, int? maxLines = 1, bool? validateOnFocusChange = true, dynamic handleValidationError(FormValidationResult handleError)?, int? minLines, bool enableSuggestions = true, String? hintText, TextStyle? hintStyle, FocusNode? focusNode, FormValidator? formValidator, FormValidatorCallback? validate, String? dummyData, dynamic onChanged(String value)?, TextStyle? style, StrutStyle? strutStyle, TextInputAction? textInputAction, bool readOnly = false, bool? showCursor, int? maxLength, bool? enabled, DragStartBehavior dragStartBehavior = DragStartBehavior.start, double? cursorHeight, Radius? cursorRadius, Color? cursorColor, GestureTapCallback? onTap, TapRegionCallback? onTapOutside, MouseCursor? mouseCursor, TextCapitalization textCapitalization = TextCapitalization.none, MaxLengthEnforcement? maxLengthEnforcement, double cursorWidth = 2.0, AppPrivateCommandCallback? onAppPrivateCommand, List<TextInputFormatter>? inputFormatters, bool expands = false, TextAlignVertical? textAlignVertical, TextDirection? textDirection, String obscuringCharacter = '•', bool autocorrect = true, SmartDashesType? smartDashesType, SmartQuotesType? smartQuotesType, InputDecoration? decoration, VoidCallback? onEditingComplete, Brightness? keyboardAppearance, EdgeInsets scrollPadding = const EdgeInsets.all(20.0), TextSelectionControls? selectionControls, ValueChanged<String>? onSubmitted, ScrollController? scrollController, ScrollPhysics? scrollPhysics, Iterable<String>? autofillHints = const <String>[], Clip clipBehavior = Clip.hardEdge, bool? passwordVisible, bool? passwordViewable, Widget? prefixIcon, Widget? suffixIcon, Color? backgroundColor, BorderRadius? borderRadius, InputBorder? border, InputBorder? focusedBorder, InputBorder? enabledBorder, EdgeInsetsGeometry? contentPadding, TextStyle? labelStyle, Widget? header, Widget? footer, bool? clearable, Widget? clearIcon, String? mask, String? maskMatch, bool? maskedReturnValue, DecoratorTextField? decorator, Field? field, String? stateName, bool enableInteractiveSelection = true})
Default Text Field
const
InputField.capitalizeWords({Key? key, required TextEditingController controller, String? labelText, FieldStyleTextField? style, bool obscureText = false, bool autoFocus = false, TextInputType keyboardType = TextInputType.text, TextAlign? textAlign, bool validateOnFocusChange = false, int maxLines = 1, dynamic handleValidationError(FormValidationResult handleError)?, int? minLines, bool enableSuggestions = true, String? hintText, TextStyle? hintStyle, FocusNode? focusNode, FormValidator? formValidator, FormValidatorCallback? validate, String? dummyData, dynamic onChanged(String value)?, StrutStyle? strutStyle, TextInputAction? textInputAction, bool readOnly = false, bool? showCursor, int? maxLength, bool? enabled, DragStartBehavior dragStartBehavior = DragStartBehavior.start, double? cursorHeight, Radius? cursorRadius, Color? cursorColor, GestureTapCallback? onTap, TapRegionCallback? onTapOutside, MouseCursor? mouseCursor, MaxLengthEnforcement? maxLengthEnforcement, double cursorWidth = 2.0, AppPrivateCommandCallback? onAppPrivateCommand, List<TextInputFormatter>? inputFormatters, bool expands = false, TextAlignVertical? textAlignVertical, TextDirection? textDirection, String obscuringCharacter = '•', bool autocorrect = true, SmartDashesType? smartDashesType, SmartQuotesType? smartQuotesType, InputDecoration? decoration, VoidCallback? onEditingComplete, Brightness? keyboardAppearance, EdgeInsets scrollPadding = const EdgeInsets.all(20.0), TextSelectionControls? selectionControls, ValueChanged<String>? onSubmitted, ScrollController? scrollController, ScrollPhysics? scrollPhysics, Iterable<String>? autofillHints = const <String>[], Clip clipBehavior = Clip.hardEdge, Widget? prefixIcon, Widget? suffixIcon, Color? backgroundColor, BorderRadius? borderRadius, InputBorder? border, InputBorder? focusedBorder, InputBorder? enabledBorder, EdgeInsetsGeometry? contentPadding, TextStyle? labelStyle, Widget? header, Widget? footer, bool? clearable, Widget? clearIcon, String? mask, String? maskMatch, bool? maskedReturnValue, DecoratorTextField? decorator, String? stateName, bool? passwordVisible, bool? passwordViewable, bool enableInteractiveSelection = true})
CapitalizeWords Text Field - auto-capitalizes each word
InputField.emailAddress({Key? key, required TextEditingController controller, String labelText = "nylo.input_field.email_address", bool obscureText = false, bool autoFocus = true, TextInputType keyboardType = TextInputType.emailAddress, TextAlign? textAlign, bool validateOnFocusChange = false, int maxLines = 1, dynamic handleValidationError(FormValidationResult handleError)?, int? minLines, bool enableSuggestions = true, String? hintText, TextStyle? hintStyle, FocusNode? focusNode, FormValidator? formValidator, FormValidatorCallback? validate, String? dummyData, dynamic onChanged(String value)?, TextStyle? style, StrutStyle? strutStyle, TextInputAction? textInputAction, bool readOnly = false, bool? showCursor, int? maxLength, bool? enabled, DragStartBehavior dragStartBehavior = DragStartBehavior.start, double? cursorHeight, Radius? cursorRadius, Color? cursorColor, GestureTapCallback? onTap, TapRegionCallback? onTapOutside, MouseCursor? mouseCursor, TextCapitalization textCapitalization = TextCapitalization.none, MaxLengthEnforcement? maxLengthEnforcement, double cursorWidth = 2.0, AppPrivateCommandCallback? onAppPrivateCommand, List<TextInputFormatter>? inputFormatters, bool expands = false, TextAlignVertical? textAlignVertical, TextDirection? textDirection, String obscuringCharacter = '•', bool autocorrect = true, SmartDashesType? smartDashesType, SmartQuotesType? smartQuotesType, bool? passwordViewable, InputDecoration? decoration, VoidCallback? onEditingComplete, Brightness? keyboardAppearance, EdgeInsets scrollPadding = const EdgeInsets.all(20.0), TextSelectionControls? selectionControls, ValueChanged<String>? onSubmitted, ScrollController? scrollController, ScrollPhysics? scrollPhysics, Iterable<String>? autofillHints = const <String>[], Clip clipBehavior = Clip.hardEdge, Widget? prefixIcon, Widget? suffixIcon, Color? backgroundColor, BorderRadius? borderRadius, InputBorder? border, InputBorder? focusedBorder, InputBorder? enabledBorder, EdgeInsetsGeometry? contentPadding, TextStyle? labelStyle, bool? passwordVisible, Widget? header, Widget? footer, bool? clearable, Widget? clearIcon, String? mask, String? maskMatch, bool? maskedReturnValue, DecoratorTextField? decorator, String? stateName, bool enableInteractiveSelection = true})
Email Address Text Field - email keyboard with autofocus
InputField.fromFieldStyleText({required Field field, FieldStyleTextField? style, FormValidator? formValidator, FormValidatorCallback? validate, dynamic onChanged(String value)?})
InputField.password({Key? key, required TextEditingController controller, String labelText = "nylo.input_field.password", bool passwordVisible = true, bool obscureText = true, bool autoFocus = false, TextInputType keyboardType = TextInputType.text, TextAlign? textAlign, int maxLines = 1, bool validateOnFocusChange = false, dynamic handleValidationError(FormValidationResult handleError)?, int? minLines, bool enableSuggestions = true, String? hintText, TextStyle? hintStyle, FocusNode? focusNode, FormValidator? formValidator, FormValidatorCallback? validate, String? dummyData, dynamic onChanged(String value)?, TextStyle? style, StrutStyle? strutStyle, TextInputAction? textInputAction, bool readOnly = false, bool? showCursor, int? maxLength, bool? enabled, DragStartBehavior dragStartBehavior = DragStartBehavior.start, double? cursorHeight, Radius? cursorRadius, Color? cursorColor, GestureTapCallback? onTap, TapRegionCallback? onTapOutside, MouseCursor? mouseCursor, TextCapitalization textCapitalization = TextCapitalization.none, MaxLengthEnforcement? maxLengthEnforcement, double cursorWidth = 2.0, AppPrivateCommandCallback? onAppPrivateCommand, List<TextInputFormatter>? inputFormatters, bool expands = false, TextAlignVertical? textAlignVertical, TextDirection? textDirection, String obscuringCharacter = '•', bool autocorrect = true, SmartDashesType? smartDashesType, SmartQuotesType? smartQuotesType, InputDecoration? decoration, VoidCallback? onEditingComplete, Brightness? keyboardAppearance, EdgeInsets scrollPadding = const EdgeInsets.all(20.0), TextSelectionControls? selectionControls, ValueChanged<String>? onSubmitted, ScrollController? scrollController, ScrollPhysics? scrollPhysics, bool? passwordViewable, Iterable<String>? autofillHints = const <String>[], Clip clipBehavior = Clip.hardEdge, Widget? prefixIcon, Widget? suffixIcon, Color? backgroundColor, BorderRadius? borderRadius, InputBorder? border, InputBorder? focusedBorder, InputBorder? enabledBorder, EdgeInsetsGeometry? contentPadding, TextStyle? labelStyle, Widget? header, Widget? footer, bool? clearable, Widget? clearIcon, String? mask, String? maskMatch, bool? maskedReturnValue, DecoratorTextField? decorator, String? stateName, bool enableInteractiveSelection = true})
Password Text Field - obscured by default with visibility toggle

Properties

autocorrect → bool
final
autofillHints → Iterable<String>?
final
autoFocus → bool
final
backgroundColor → Color?
final
border → InputBorder?
final
borderRadius → BorderRadius?
final
clearable → bool?
final
clearIcon → Widget?
final
clipBehavior → Clip
final
contentPadding → EdgeInsetsGeometry?
final
controller → TextEditingController
final
cursorColor → Color?
final
cursorHeight → double?
final
cursorRadius → Radius?
final
cursorWidth → double
final
decoration → InputDecoration?
final
decorator → DecoratorTextField?
final
dragStartBehavior → DragStartBehavior
final
dummyData → String?
final
enabled → bool?
final
enabledBorder → InputBorder?
final
enableInteractiveSelection → bool
final
enableSuggestions → bool
final
expands → bool
final
field → Field?
final
focusedBorder → InputBorder?
final
focusNode → FocusNode?
final
final
formValidator → FormValidator?
Validates the field's current value. See FormValidator for the three supported patterns (named constructor, chainable API, or explicit rule list). The first failing rule's message renders as the field's error text.
final
handleValidationError → dynamic Function(FormValidationResult handleError)?
final
hashCode → int
The hash code for this object.
no setterinherited
final
hintStyle → TextStyle?
final
hintText → String?
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
mask → String?
final
maskedReturnValue → bool?
final
maskMatch → String?
final
maxLength → int?
final
maxLengthEnforcement → MaxLengthEnforcement?
final
maxLines → int?
final
minLines → int?
final
mouseCursor → MouseCursor?
final
obscureText → bool
final
obscuringCharacter → String
final
onAppPrivateCommand → AppPrivateCommandCallback?
final
onChanged → dynamic Function(String value)?
final
onEditingComplete → VoidCallback?
final
onSubmitted → ValueChanged<String>?
final
onTap → VoidCallback?
final
onTapOutside → TapRegionCallback?
final
passwordViewable → bool?
final
passwordVisible → bool?
final
prefixIcon → Widget?
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
smartDashesType → SmartDashesType?
final
smartQuotesType → SmartQuotesType?
final
stateName → String?
final
strutStyle → StrutStyle?
final
style → TextStyle?
final
suffixIcon → Widget?
final
textAlign → TextAlign?
final
textAlignVertical → TextAlignVertical?
final
textCapitalization → TextCapitalization
final
textDirection → TextDirection?
final
textInputAction → TextInputAction?
final
validate → FormValidatorCallback?
Closure-based validator. Receives a fresh FormValidator and the current field value; register rules via validate.that(data, attribute).<rule>().
final
validateOnFocusChange → bool?
final

Methods

connectiveOr({required Widget offline}) → Widget

Available on Widget, provided by the ConnectiveExtension extension

Wraps the widget in a Connective that shows an offline placeholder.
copyWith({String? labelText, TextStyle? labelStyle, TextEditingController? controller, bool? obscureText, int? maxLines, int? minLines, TextInputType? keyboardType, bool? autoFocus, TextAlign? textAlign, bool? enableSuggestions, FocusNode? focusNode, String? hintText, TextStyle? hintStyle, FormValidator? formValidator, FormValidatorCallback? validate, String? dummyData, dynamic onChanged(String value)?, TextInputAction? textInputAction, TextStyle? style, StrutStyle? strutStyle, TextAlignVertical? textAlignVertical, TextDirection? textDirection, String? obscuringCharacter, bool? autocorrect, SmartDashesType? smartDashesType, SmartQuotesType? smartQuotesType, bool? expands, bool? readOnly, bool? showCursor, int? maxLength, bool? passwordViewable, bool? validateOnFocusChange, MouseCursor? mouseCursor, String? validationErrorMessage, TextCapitalization? textCapitalization, MaxLengthEnforcement? maxLengthEnforcement, AppPrivateCommandCallback? onAppPrivateCommand, List<TextInputFormatter>? inputFormatters, bool? enabled, double? cursorWidth, double? cursorHeight, Radius? cursorRadius, Color? cursorColor, Brightness? keyboardAppearance, EdgeInsets? scrollPadding, TextSelectionControls? selectionControls, DragStartBehavior? dragStartBehavior, GestureTapCallback? onTap, TapRegionCallback? onTapOutside, InputDecoration? decoration, VoidCallback? onEditingComplete, ValueChanged<String>? onSubmitted, ScrollController? scrollController, ScrollPhysics? scrollPhysics, Iterable<String>? autofillHints, Clip? clipBehavior, dynamic handleValidationError(String value)?, bool? passwordVisible, Widget? prefixIcon, Widget? suffixIcon, Color? backgroundColor, BorderRadius? borderRadius, InputBorder? border, InputBorder? focusedBorder, InputBorder? enabledBorder, EdgeInsetsGeometry? contentPadding, bool customValidationRule(dynamic value)?, String? title, TextStyle? titleStyle, bool? clearable, Widget? clearIcon, String? mask, String? maskMatch, bool? maskedReturnValue, DecoratorTextField? decorator, bool? enableInteractiveSelection}) → InputField
Copy with method
createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<StatefulWidget>
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
faderBottom({double strength = 0.2, Color color = Colors.black}) → FadeOverlay

Available on StatefulWidget, provided by the NyStatefulExt extension

Make gradient fader from the bottom of the widget. strength ranges from 0.0 (subtle) to 1.0 (strong).
faderFrom({double strength = 0.2, Color color = Colors.black, AlignmentGeometry begin = Alignment.topCenter, AlignmentGeometry end = Alignment.bottomCenter}) → FadeOverlay

Available on StatefulWidget, provided by the NyStatefulExt extension

Make gradient fader with custom alignment. strength ranges from 0.0 (subtle) to 1.0 (strong).
faderLeft({double strength = 0.2, Color color = Colors.black}) → FadeOverlay

Available on StatefulWidget, provided by the NyStatefulExt extension

Make gradient fader from the left of the widget. strength ranges from 0.0 (subtle) to 1.0 (strong).
faderRight({double strength = 0.2, Color color = Colors.black}) → FadeOverlay

Available on StatefulWidget, provided by the NyStatefulExt extension

Make gradient fader from the right of the widget. strength ranges from 0.0 (subtle) to 1.0 (strong).
faderTop({double strength = 0.2, Color color = Colors.black}) → FadeOverlay

Available on StatefulWidget, provided by the NyStatefulExt extension

Make gradient fader from the top of the widget. strength ranges from 0.0 (subtle) to 1.0 (strong).
flexible({Key? key, int flex = 1, FlexFit fit = FlexFit.loose}) → Flexible

Available on StatefulWidget, provided by the NyStatefulExt extension

Make a StatefulWidget Flexible.
merge(InputDecoration decoration) → InputField
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onlyOffline() → Widget

Available on Widget, provided by the ConnectiveExtension extension

Only shows the widget when offline, otherwise shows nothing.
onlyOnline() → Widget

Available on Widget, provided by the ConnectiveExtension extension

Only shows the widget when online, otherwise shows nothing.
paddingOnly({double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0}) → Padding

Available on StatefulWidget, provided by the NyStatefulExt extension

Add padding to the widget.
paddingSymmetric({double horizontal = 0.0, double vertical = 0.0}) → Padding

Available on StatefulWidget, provided by the NyStatefulExt extension

Add symmetric padding to the widget.
pullable({required Future<void> onRefresh()?, PullableConfig? pullableConfig}) → Widget

Available on Widget, provided by the NyWidgetExt extension

Make a widget pullable using the Pullable widget.
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toSkeleton({Key? key, bool? ignoreContainers, bool? justifyMultiLineText, Color? containersColor, bool ignorePointers = true, bool enabled = true, PaintingEffect? effect, TextBoneBorderRadius? textBoneBorderRadius}) → Skeletonizer

Available on Widget, provided by the NyWidgetExt extension

Make a widget a skeleton using the Skeletonizer package.
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
visibleWhen(bool condition) → Widget

Available on StatefulWidget, provided by the NyStatefulExt extension

Make a widget visible when a condition is true.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

stateActions(String stateName) → TextFieldStateActions
StateActions for the text field