RemixTextField class

A customizable text field component that supports various styles and behaviors. The text field integrates with the Mix styling system and follows Remix design patterns.

Example

RemixTextField(
  controller: _controller,
  hintText: 'Enter your name',
  helperText: 'Required field',
  onChanged: (value) {
    debugPrint('Value changed: $value');
  },
  style: TextFieldStyler(),
)
Inheritance
Implementers

Constructors

RemixTextField({Key? key, TextEditingController? controller, FocusNode? focusNode, String? label, String? hintText, String? helperText, bool error = false, TextInputType? keyboardType, TextInputAction? textInputAction, TextCapitalization textCapitalization = .none, TextDirection? textDirection, bool obscureText = false, bool enabled = true, bool readOnly = false, bool autofocus = false, int? maxLines = 1, int? minLines, bool expands = false, int? maxLength, MaxLengthEnforcement? maxLengthEnforcement, ValueChanged<String>? onChanged, VoidCallback? onEditingComplete, ValueChanged<String>? onSubmitted, AppPrivateCommandCallback? onAppPrivateCommand, List<TextInputFormatter>? inputFormatters, bool? showCursor, String obscuringCharacter = '•', bool autocorrect = true, bool enableSuggestions = true, SmartDashesType? smartDashesType, SmartQuotesType? smartQuotesType, DragStartBehavior dragStartBehavior = .start, bool enableInteractiveSelection = true, TextSelectionControls? selectionControls, GestureTapCallback? onTap, TapRegionCallback? onTapOutside, TapRegionUpCallback? onPressUpOutside, bool onTapAlwaysCalled = false, ScrollController? scrollController, ScrollPhysics? scrollPhysics, Iterable<String>? autofillHints, ContentInsertionConfiguration? contentInsertionConfiguration, Clip clipBehavior = .hardEdge, String? restorationId, bool stylusHandwritingEnabled = true, bool enableIMEPersonalizedLearning = true, EditableTextContextMenuBuilder? contextMenuBuilder, SpellCheckConfiguration? spellCheckConfiguration, TextMagnifierConfiguration? magnifierConfiguration, bool canRequestFocus = true, bool? ignorePointers, UndoHistoryController? undoController, Object groupId = EditableText, Widget? leading, Widget? trailing, String? semanticLabel, String? semanticHint, bool excludeSemantics = false, TextFieldStyler style = const TextFieldStyler.create(), TextFieldSpec? styleSpec})
const

Properties

autocorrect → bool
Whether to enable autocorrect.
final
autofillHints → Iterable<String>?
A list of strings that helps the autofill service identify the type of this text input.
final
autofocus → bool
Whether this text field should focus itself if nothing else is already focused.
final
canRequestFocus → bool
Whether this text field can request focus.
final
clipBehavior → Clip
The content will be clipped (or not) according to this option.
final
contentInsertionConfiguration → ContentInsertionConfiguration?
Configuration for content insertion.
final
contextMenuBuilder → EditableTextContextMenuBuilder?
A context menu builder for the text field.
final
controller → TextEditingController?
Controls the text being edited.
final
dragStartBehavior → DragStartBehavior
Defines how to handle drag start behavior.
final
enabled → bool
Whether the text field is enabled.
final
enableIMEPersonalizedLearning → bool
Whether to enable that the IME update personalized data.
final
enableInteractiveSelection → bool
Whether to enable user interface affordances for changing the text selection.
final
enableSuggestions → bool
Whether to show input suggestions as the user types.
final
error → bool
Whether the text field is in error state.
final
excludeSemantics → bool
Whether to exclude child semantics.
final
expands → bool
Whether this widget's height will be sized to fill its parent.
final
focusNode → FocusNode?
Defines the keyboard focus for this widget.
final
groupId → Object
The group ID for the text field.
final
hashCode → int
The hash code for this object.
no setterinherited
helperText → String?
Helper text to display below the text field.
final
hintText → String?
Hint text to display when the text field is empty.
final
ignorePointers → bool?
Whether to ignore pointer events.
final
inputFormatters → List<TextInputFormatter>?
Optional input formatters.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardType → TextInputType?
The type of keyboard to use for editing the text.
final
label → String?
Label text to display above the text field.
final
leading → Widget?
A widget to display at the leading edge of the text field.
final
magnifierConfiguration → TextMagnifierConfiguration?
Configuration for text magnification.
final
maxLength → int?
The maximum number of characters to allow in the text field.
final
maxLengthEnforcement → MaxLengthEnforcement?
How the maxLength limit should be enforced.
final
maxLines → int?
The maximum number of lines for the text to span.
final
minLines → int?
The minimum number of lines to occupy when the content spans fewer lines.
final
obscureText → bool
Whether to hide the text being edited.
final
obscuringCharacter → String
Character used for obscuring text if obscureText is true.
final
onAppPrivateCommand → AppPrivateCommandCallback?
This is used to receive a private command from the input method.
final
onChanged → ValueChanged<String>?
Called when the user initiates a change to the TextField's value.
final
onEditingComplete → VoidCallback?
Called when the user submits editable content.
final
onPressUpOutside → TapRegionUpCallback?
Called when tap up is detected outside of this text field.
final
onSubmitted → ValueChanged<String>?
Called when the user indicates that they are done editing the text in the field.
final
onTap → VoidCallback?
Called when the text field is tapped.
final
onTapAlwaysCalled → bool
Whether onTap should be called for every tap.
final
onTapOutside → TapRegionCallback?
Called when the user taps outside of this text field.
final
readOnly → bool
Whether the text can be changed.
final
restorationId → String?
Restoration ID to save and restore the state of the text field.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scrollController → ScrollController?
The ScrollController to use when vertically scrolling the input.
final
scrollPhysics → ScrollPhysics?
The ScrollPhysics to use when vertically scrolling the input.
final
selectionControls → TextSelectionControls?
Replaces Remix's visible text selection handles when provided. With the default handles, a context menu is supplied separately through contextMenuBuilder.
final
semanticHint → String?
The semantic hint for the text field.
final
semanticLabel → String?
The semantic label for the text field.
final
showCursor → bool?
Whether to show cursor.
final
smartDashesType → SmartDashesType?
Configuration for smart dashes.
final
smartQuotesType → SmartQuotesType?
Configuration for smart quotes.
final
spellCheckConfiguration → SpellCheckConfiguration?
Configuration for spell checking.
final
style → TextFieldStyler
The style configuration for the text field.
final
styleSpec → TextFieldSpec?
The style spec for the text field.
final
stylusHandwritingEnabled → bool
Whether stylus handwriting is enabled.
final
textCapitalization → TextCapitalization
Configures how the platform keyboard will select an uppercase or lowercase keyboard.
final
textDirection → TextDirection?
The directionality of the text.
final
textInputAction → TextInputAction?
The type of action button to use for the keyboard.
final
trailing → Widget?
A widget to display at the trailing edge of the text field.
final
undoController → UndoHistoryController?
Undo controller for managing undo/redo operations.
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

Static Properties

styleFrom → TextFieldStyler Function({AnimationConfig? animation, BoxStyler? container, RemixBoxEffectsMix? containerEffects, CrossAxisAlignment? crossAxisAlignment, Color? cursorColor, double? cursorHeight, bool? cursorOpacityAnimates, Radius? cursorRadius, double? cursorWidth, TextStyler? helperText, TextStyler? hintText, Brightness? keyboardAppearance, TextStyler? label, FlexBoxStyler? layout, WidgetModifierConfig? modifier, EdgeInsets? scrollPadding, BoxHeightStyle? selectionHeightStyle, BoxWidthStyle? selectionWidthStyle, double? spacing, TextStyler? text, TextAlign? textAlign, List<VariantStyle<TextFieldSpec>>? variants})
final