SuperTextField class
Custom text field implementations that offer greater control than traditional Flutter text fields.
For example, the custom text fields in this package use AttributedText
instead of regular String
s or InlineSpan
s, which makes it easier style
text and add other text metadata.
Text field that supports styled text.
SuperTextField adapts to the expectations of the current platform, or conforms to a specified configuration.
- desktop uses physical keyboard handlers with a blinking cursor and mouse gestures
- Android uses IME text input with draggable handles in the Android style
- iOS uses IME text input with draggable handles in the iOS style
SuperTextField is built on top of platform-specific text field implementations, which may offer additional customization beyond that of SuperTextField:
- SuperDesktopTextField, which uses physical keyboard handlers and mouse gestures
- SuperAndroidTextField, which uses IME text input with Android-style handles
- SuperIOSTextField, which uses IME text input with iOS-style handles
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- SuperTextField
Constructors
-
SuperTextField.new({Key? key, FocusNode? focusNode, SuperTextFieldPlatformConfiguration? configuration, AttributedTextEditingController? textController, TextAlign textAlign = TextAlign.left, AttributionStyleBuilder textStyleBuilder = defaultTextFieldStyleBuilder, HintBehavior hintBehavior = HintBehavior.displayHintUntilFocus, WidgetBuilder? hintBuilder, Color? controlsColor, CaretStyle? caretStyle, Color? selectionColor, int? minLines, int? maxLines = 1, double? lineHeight, TextInputSource? inputSource, List<
TextFieldKeyboardHandler> ? keyboardHandlers, EdgeInsets? padding, TextInputAction? textInputAction}) -
const
Properties
- caretStyle → CaretStyle?
-
The visual representation of the caret.
final
- configuration → SuperTextFieldPlatformConfiguration?
-
The platform-style configuration for this text field, or
null
to automatically configure for the current platform.final - controlsColor → Color?
-
The color of the caret, drag handles, and other controls.
final
- focusNode → FocusNode?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hintBehavior → HintBehavior
-
Policy for when the hint should be displayed.
final
- hintBuilder → WidgetBuilder?
-
Builder that creates the hint widget, when a hint is displayed.
final
- inputSource → TextInputSource?
-
The SuperTextField input source, e.g., keyboard or Input Method Engine.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
keyboardHandlers
→ List<
TextFieldKeyboardHandler> ? -
Priority list of handlers that process all physical keyboard
key presses, for text input, deletion, caret movement, etc.
final
- lineHeight → double?
-
The height of a single line of text in this text field, used
with minLines and maxLines to size the text field.
final
- maxLines → int?
-
The maximum height of this text field, represented as a
line count.
final
- minLines → int?
-
The minimum height of this text field, represented as a
line count.
final
- padding → EdgeInsets?
-
Padding placed around the text content of this text field, but within the
scrollable viewport.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectionColor → Color?
-
The color of selection rectangles that appear around selected text.
final
- textAlign → TextAlign
-
The alignment of the text in this text field.
final
- textController → AttributedTextEditingController?
-
Controller that holds the current text and selection for this field,
similar to a standard Flutter
TextEditingController
.final - textInputAction → TextInputAction?
-
The main action for the virtual keyboard, e.g. TextInputAction.done.
final
- textStyleBuilder → AttributionStyleBuilder
-
Text style factory that creates styles for the content in
textController based on the attributions in that content.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< SuperTextField> -
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