MasterTextField class
MasterTextField - Optimized & Refactored
- Keeps all your original properties
- Adds missing/latest Flutter properties (InputDecoration, EditableText, TextField/TextFormField)
- Avoids duplicate code between TextField and TextFormField
NOTE: This aims to support the latest stable Flutter API. If your project uses an older Flutter SDK you might need to remove/adjust a few newer properties.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- MasterTextField
Constructors
-
MasterTextField({Key? key, TextEditingController? controller, FocusNode? focusNode, InputDecoration? decoration, String? labelText, TextStyle? labelStyle, String? hintText, TextStyle? hintStyle, String? prefixText, IconData? prefixIcon, Widget? prefix, BoxConstraints? prefixIconConstraints, TextStyle? prefixStyle, String? suffixText, IconData? suffixIcon, Widget? suffix, BoxConstraints? suffixIconConstraints, TextStyle? suffixStyle, Widget? prefixIconWidget, Widget? suffixIconWidget, String? helperText, TextStyle? helperStyle, int? helperMaxLines, String? counterText, TextStyle? counterStyle, InputCounterWidgetBuilder? buildCounter, String? semanticCounterText, String? errorText, TextStyle? errorStyle, int? errorMaxLines, bool isDense = false, EdgeInsetsGeometry? contentPadding, bool isCollapsed = false, BoxConstraints? constraints, FloatingLabelBehavior? floatingLabelBehavior, FloatingLabelAlignment? floatingLabelAlignment, bool? alignLabelWithHint, InputBorder? border, InputBorder? enabledBorder, InputBorder? disabledBorder, InputBorder? focusedBorder, InputBorder? errorBorder, InputBorder? focusedErrorBorder, bool filled = false, Color? fillColor, TextStyle? style, TextAlign textAlign = TextAlign.start, TextDirection? textDirection, TextAlignVertical? textAlignVertical, Color? cursorColor, double? cursorWidth, double? cursorHeight, Radius? cursorRadius, bool? cursorOpacityAnimates, TextInputType? keyboardType, TextInputAction? textInputAction, TextCapitalization textCapitalization = TextCapitalization.none, List<
TextInputFormatter> ? inputFormatters, bool readOnly = false, bool enabled = true, bool obscureText = false, String obscuringCharacter = '•', bool autocorrect = true, bool? showCursor, bool enableSuggestions = true, bool enableInteractiveSelection = true, int? maxLines = 1, int? minLines, bool expands = false, int? maxLength, MaxLengthEnforcement? maxLengthEnforcement, bool autofocus = false, ValueChanged<String> ? onChanged, ValueChanged<String> ? onSubmitted, GestureTapCallback? onTap, VoidCallback? onEditingComplete, FormFieldValidator<String> ? validator, AutovalidateMode? autovalidateMode, String? restorationId, Brightness? keyboardAppearance, StrutStyle? strutStyle, EdgeInsets scrollPadding = const EdgeInsets.all(20.0), bool? enableIMEPersonalizedLearning, ScrollController? scrollController, ScrollPhysics? scrollPhysics, bool selectAllOnFocus = false, EditableTextContextMenuBuilder? contextMenuBuilder, TextMagnifierConfiguration? magnifierConfiguration, SpellCheckConfiguration? spellCheckConfiguration, TextSelectionControls? selectionControls, SmartQuotesType? smartQuotesType, SmartDashesType? smartDashesType, DragStartBehavior dragStartBehavior = DragStartBehavior.start, bool canRequestFocus = true, void onTapOutside(PointerDownEvent event)?, BoxHeightStyle? selectionHeightStyle, BoxWidthStyle? selectionWidthStyle, MouseCursor? mouseCursor, bool? stylusHandwritingEnabled, bool? scribbleEnabled, Clip clipBehavior = Clip.hardEdge, bool? enableInteractiveSelectionToolbar, List<String> ? autofillHints}) -
const
Properties
- alignLabelWithHint → bool?
-
final
- autocorrect → bool
-
final
-
autofillHints
→ List<
String> ? -
final
- autofocus → bool
-
final
- autovalidateMode → AutovalidateMode?
-
final
- border → InputBorder?
-
final
- buildCounter → InputCounterWidgetBuilder?
-
final
- canRequestFocus → bool
-
final
- clipBehavior → Clip
-
final
- constraints → BoxConstraints?
-
final
- contentPadding → EdgeInsetsGeometry?
-
final
- contextMenuBuilder → EditableTextContextMenuBuilder?
-
final
- controller → TextEditingController?
-
final
- counterStyle → TextStyle?
-
final
- counterText → String?
-
final
- cursorColor → Color?
-
final
- cursorHeight → double?
-
final
- cursorOpacityAnimates → bool?
-
final
- cursorRadius → Radius?
-
final
- cursorWidth → double?
-
final
- decoration → InputDecoration?
-
final
- disabledBorder → InputBorder?
-
final
- dragStartBehavior → DragStartBehavior
-
final
- enabled → bool
-
final
- enabledBorder → InputBorder?
-
final
- enableIMEPersonalizedLearning → bool?
-
final
- enableInteractiveSelection → bool
-
final
- enableInteractiveSelectionToolbar → bool?
-
final
- enableSuggestions → bool
-
final
- errorBorder → InputBorder?
-
final
- errorMaxLines → int?
-
final
- errorStyle → TextStyle?
-
final
- errorText → String?
-
final
- expands → bool
-
final
- fillColor → Color?
-
final
- filled → bool
-
final
- floatingLabelAlignment → FloatingLabelAlignment?
-
final
- floatingLabelBehavior → FloatingLabelBehavior?
-
final
- focusedBorder → InputBorder?
-
final
- focusedErrorBorder → InputBorder?
-
final
- focusNode → FocusNode?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- helperMaxLines → int?
-
final
- helperStyle → TextStyle?
-
final
- helperText → String?
-
final
- hintStyle → TextStyle?
-
final
- hintText → String?
-
final
-
inputFormatters
→ List<
TextInputFormatter> ? -
final
- isCollapsed → bool
-
final
- isDense → bool
-
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
- magnifierConfiguration → TextMagnifierConfiguration?
-
final
- maxLength → int?
-
final
- maxLengthEnforcement → MaxLengthEnforcement?
-
final
- maxLines → int?
-
final
- minLines → int?
-
final
- mouseCursor → MouseCursor?
-
final
- obscureText → bool
-
final
- obscuringCharacter → String
-
final
-
onChanged
→ ValueChanged<
String> ? -
final
- onEditingComplete → VoidCallback?
-
final
-
onSubmitted
→ ValueChanged<
String> ? -
final
- onTap → VoidCallback?
-
final
- onTapOutside → void Function(PointerDownEvent event)?
-
final
- prefix → Widget?
-
final
- prefixIcon → IconData?
-
final
- prefixIconConstraints → BoxConstraints?
-
final
- prefixIconWidget → Widget?
-
final
- prefixStyle → TextStyle?
-
final
- prefixText → String?
-
final
- readOnly → bool
-
final
- restorationId → String?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scribbleEnabled → bool?
-
final
- scrollController → ScrollController?
-
final
- scrollPadding → EdgeInsets
-
final
- scrollPhysics → ScrollPhysics?
-
final
- selectAllOnFocus → bool
-
final
- selectionControls → TextSelectionControls?
-
final
- selectionHeightStyle → BoxHeightStyle?
-
final
- selectionWidthStyle → BoxWidthStyle?
-
final
- semanticCounterText → String?
-
final
- showCursor → bool?
-
final
- smartDashesType → SmartDashesType?
-
final
- smartQuotesType → SmartQuotesType?
-
final
- spellCheckConfiguration → SpellCheckConfiguration?
-
final
- strutStyle → StrutStyle?
-
final
- style → TextStyle?
-
final
- stylusHandwritingEnabled → bool?
-
final
- suffix → Widget?
-
final
- suffixIcon → IconData?
-
final
- suffixIconConstraints → BoxConstraints?
-
final
- suffixIconWidget → Widget?
-
final
- suffixStyle → TextStyle?
-
final
- suffixText → String?
-
final
- textAlign → TextAlign
-
final
- textAlignVertical → TextAlignVertical?
-
final
- textCapitalization → TextCapitalization
-
final
- textDirection → TextDirection?
-
final
- textInputAction → TextInputAction?
-
final
-
validator
→ FormFieldValidator<
String> ? -
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, 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