CustomInput class
Extension methods for Iterable<Widget> to insert separators between items. A highly customizable text input field with support for leading and trailing widgets.
The CustomInput widget provides a fully-featured text input field with comprehensive styling options, placeholder support, and advanced text editing capabilities.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- CustomInput
- Available extensions
Constructors
-
CustomInput({Key? key, String? initialValue, Widget? placeholder, TextEditingController? controller, FocusNode? focusNode, BoxDecoration? decoration, UndoHistoryController? undoController, TextInputType? keyboardType, TextInputAction? textInputAction, TextCapitalization textCapitalization = TextCapitalization.none, TextStyle? style, StrutStyle? strutStyle, TextAlign textAlign = TextAlign.start, TextDirection? textDirection, bool readOnly = false, bool? showCursor, bool autofocus = false, String obscuringCharacter = '•', bool obscureText = false, bool autocorrect = true, SmartDashesType? smartDashesType, SmartQuotesType? smartQuotesType, bool enableSuggestions = true, 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 enabled = true, double? cursorWidth, double? cursorHeight, Radius? cursorRadius, bool? cursorOpacityAnimates, Color? cursorColor, BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight, BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight, Brightness? keyboardAppearance, EdgeInsets scrollPadding = const EdgeInsets.all(20), DragStartBehavior dragStartBehavior = DragStartBehavior.start, bool? enableInteractiveSelection, TextSelectionControls? selectionControls, GestureTapCallback? onPressed, bool onPressedAlwaysCalled = false, TapRegionCallback? onPressedOutside, MouseCursor? mouseCursor, ScrollController? scrollController, ScrollPhysics? scrollPhysics, Iterable<String> ? autofillHints = const <String>[], ContentInsertionConfiguration? contentInsertionConfiguration, Clip clipBehavior = Clip.hardEdge, String? restorationId, bool scribbleEnabled = true, bool enableIMEPersonalizedLearning = true, EditableTextContextMenuBuilder? contextMenuBuilder, SpellCheckConfiguration? spellCheckConfiguration, TextMagnifierConfiguration magnifierConfiguration = TextMagnifierConfiguration.disabled, Color? selectionColor, EdgeInsetsGeometry? padding, Widget? leading, Widget? trailing, MainAxisAlignment? mainAxisAlignment, CrossAxisAlignment? crossAxisAlignment, TextStyle? placeholderStyle, AlignmentGeometry? alignment, AlignmentGeometry? placeholderAlignment, EdgeInsetsGeometry? inputPadding, double? gap, BoxConstraints? constraints, bool stylusHandwritingEnabled = EditableText.defaultStylusHandwritingEnabled, Object? groupId, EdgeInsetsGeometry? scrollbarPadding, WidgetBuilder? keyboardToolbarBuilder, Widget? top, Widget? bottom, ValueChanged<int> ? onLineCountChange, Size? editableTextSize, double? verticalGap, CustomInputTheme? theme}) -
Creates a CustomInput widget.
const
Properties
- alignment → AlignmentGeometry?
-
Alignment of the input field within its container.
final
- autocorrect → bool
-
Whether to enable automatic correction.
final
-
autofillHints
→ Iterable<
String> ? -
Hints for autofill services.
final
- autofocus → bool
-
Whether this text field should focus itself if nothing else is already
focused.
final
- bottom → Widget?
-
Widget displayed below the input field.
final
- box → Container
-
Available on Widget, provided by the WidgetToBox extension
no setter - clipBehavior → Clip
-
How to clip the text field during painting.
final
- constraints → BoxConstraints?
-
Constraints applied to the input field.
final
- contentInsertionConfiguration → ContentInsertionConfiguration?
-
Configuration for content insertion.
final
- contextMenuBuilder → EditableTextContextMenuBuilder?
-
Builder for the context menu.
final
- controller → TextEditingController?
-
Controls the text being edited.
final
- crossAxisAlignment → CrossAxisAlignment?
-
Cross axis alignment for the input row.
final
- cursorColor → Color?
-
The color of the cursor.
final
- cursorHeight → double?
-
The height of the cursor.
final
- cursorOpacityAnimates → bool?
-
Whether the cursor will animate from fully transparent to fully opaque.
final
- cursorRadius → Radius?
-
The radius of the cursor.
final
- cursorWidth → double?
-
The width of the cursor.
final
- decoration → BoxDecoration?
-
Visual decoration for the input field.
final
- dragStartBehavior → DragStartBehavior
-
Determines the way drag start behavior is handled.
final
- editableTextSize → Size?
-
Size of the underlying EditableText widget.
final
- enabled → bool
-
Whether the text field is interactive.
final
- enableIMEPersonalizedLearning → bool
-
Whether IME personalized learning is enabled.
final
- enableInteractiveSelection → bool
-
Whether to enable user interface affordances for changing the text selection.
final
- enableSuggestions → bool
-
Whether to enable suggestions for the current input.
final
- expands → bool
-
Whether the text field expands to fill available vertical space.
final
- focusNode → FocusNode?
-
Controls whether this text field has keyboard focus.
final
- gap → double?
-
Gap between the input field and its leading/trailing widgets.
final
- groupId → Object?
-
Identifier for grouping multiple text fields.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialValue → String?
-
The initial text value of the input field.
final
-
inputFormatters
→ List<
TextInputFormatter> ? -
Optional input validation and formatting.
final
- inputPadding → EdgeInsetsGeometry?
-
Padding around the editable text within the input field.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardAppearance → Brightness?
-
The brightness of the keyboard.
final
- keyboardToolbarBuilder → WidgetBuilder?
-
Builder for the custom keyboard toolbar.
final
- keyboardType → TextInputType
-
The type of keyboard to display for text input.
final
- leading → Widget?
-
Widget displayed before the input field.
final
- magnifierConfiguration → TextMagnifierConfiguration
-
Configuration for the magnifier.
final
- mainAxisAlignment → MainAxisAlignment?
-
Main axis alignment for the input row.
final
- maxLength → int?
-
The maximum number of characters (Unicode scalar values) to allow.
final
- maxLengthEnforcement → MaxLengthEnforcement?
-
Determines 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.
final
- mouseCursor → MouseCursor?
-
The cursor for a mouse pointer when it enters or is hovering over the widget.
final
- obscureText → bool
-
Whether to hide the text being edited.
final
- obscuringCharacter → String
-
Character used for obscuring text when obscureText is true.
final
- onAppPrivateCommand → AppPrivateCommandCallback?
-
Called for private commands from the input method.
final
-
onChanged
→ ValueChanged<
String> ? -
Called when the text being edited changes.
final
- onEditingComplete → VoidCallback?
-
Called when the user submits editable content.
final
-
onLineCountChange
→ ValueChanged<
int> ? -
Called when the line count changes.
final
- onPressed → GestureTapCallback?
-
Called when the input field is tapped.
final
- onPressedAlwaysCalled → bool
-
Whether onPressed should always be called.
final
- onPressedOutside → TapRegionCallback?
-
Called when tapping outside the input field.
final
-
onSubmitted
→ ValueChanged<
String> ? -
Called when the user indicates they are done editing.
final
- padding → EdgeInsetsGeometry?
-
Padding around the entire input field.
final
- placeholder → Widget?
-
The placeholder widget displayed when the input is empty.
final
- placeholderAlignment → AlignmentGeometry?
-
Alignment of the placeholder within the input field.
final
- placeholderStyle → TextStyle?
-
Text style for the placeholder.
final
- readOnly → bool
-
Whether the text field should be read-only.
final
- restorationId → String?
-
Restoration ID for state restoration.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scribbleEnabled → bool
-
Whether scribble input is enabled.
final
- scrollbarPadding → EdgeInsetsGeometry?
-
The color and size of the scrollbar thumb.
final
- scrollController → ScrollController?
-
Controls the scroll position of the text field.
final
- scrollPadding → EdgeInsets
-
How much space to place around the text when scrolling.
final
- scrollPhysics → ScrollPhysics?
-
The physics of the scrollable text field.
final
- selectionColor → Color?
-
The color of the text selection highlight.
final
- selectionControls → TextSelectionControls?
-
Optional delegate for building the text selection handles and toolbar.
final
- selectionEnabled → bool
-
Whether text selection is enabled.
no setter
- selectionHeightStyle → BoxHeightStyle
-
The height style of the selection highlight.
final
- selectionWidthStyle → BoxWidthStyle
-
The width style of the selection highlight.
final
- showCursor → bool?
-
Whether to show the cursor.
final
- smartDashesType → SmartDashesType
-
Smart dashes behavior for the input.
final
- smartQuotesType → SmartQuotesType
-
Smart quotes behavior for the input.
final
- spellCheckConfiguration → SpellCheckConfiguration?
-
Configuration for spell checking.
final
- strutStyle → StrutStyle?
-
The strut style to use for the text being edited.
final
- style → TextStyle?
-
The style to use for the text being edited.
final
- stylusHandwritingEnabled → bool
-
Whether stylus handwriting is enabled.
final
- textAlign → TextAlign
-
How the text should be aligned horizontally.
final
- textCapitalization → TextCapitalization
-
Configures how the platform keyboard capitalizes text.
final
- textDirection → TextDirection?
-
The directionality of the text.
final
- textInputAction → TextInputAction?
-
The action button on the keyboard.
final
- theme → CustomInputTheme?
-
Theme configuration for the input field.
final
- top → Widget?
-
Widget displayed above the input field.
final
- trailing → Widget?
-
Widget displayed after the input field.
final
- undoController → UndoHistoryController?
-
Controls undo and redo operations.
final
- verticalGap → double?
-
Gap between the input field and its top/bottom widgets.
final
Methods
-
aligned(
[AlignmentGeometry alignment = Alignment.center]) → Widget -
Available on Widget, provided by the WidgetStackExtensions extension
Wraps the widget in an Align widget -
asColumn(
{MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start}) → Widget -
Available on Widget, provided by the ColumnWidget extension
-
blurEffect(
{double blur = 10.0, double borderRadius = 12.0, Border? border, Color? tint, Gradient? gradient, List< BoxShadow> ? shadow, Clip clipBehavior = Clip.antiAlias, EdgeInsetsGeometry? padding}) → Widget -
Available on Widget, provided by the BlurEffectWidget extension
-
center(
) → Widget -
Available on Widget, provided by the CenterWidget extension
-
centered(
) → Widget -
Available on Widget, provided by the WidgetStackExtensions extension
Wraps the widget in a Center widget -
circular(
{double radius = 50.0, Color? color, BoxFit fit = BoxFit.cover}) → Widget -
Available on Widget, provided by the CircularWidget extension
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< CustomInput> -
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
-
onTap(
void onTap()) → Widget -
Available on Widget, provided by the OnTapGesture extension
-
positioned(
{double? top, double? left, double? right, double? bottom, double? width, double? height}) → Widget -
Available on Widget, provided by the WidgetStackExtensions extension
Places the widget inside a Stack using Positioned If any values are null, it behaves as partially positioned. -
positionedFill(
) → Widget -
Available on Widget, provided by the WidgetStackExtensions extension
Wraps the widget in a Positioned.fill -
positionedFromRect(
Rect rect) → Widget -
Available on Widget, provided by the WidgetStackExtensions extension
Wraps in a Positioned.fromRect (helper for Rect positioning) -
rounded(
{double borderRadius = 16.0, Color? color, BoxFit fit = BoxFit.cover}) → Widget -
Available on Widget, provided by the RoundedWidget extension
-
scrollable(
{Axis scrollDirection = Axis.vertical, bool reverse = false, EdgeInsetsGeometry? padding, bool primary = false, ScrollPhysics? physics, ScrollController? controller, Clip clipBehavior = Clip.hardEdge, String? restorationId, Key? key}) → Widget -
Available on Widget, provided by the ScrollableWidget extension
-
sizedBox(
{double? width, double? height}) → Widget -
Available on Widget, provided by the SizedBoxWidget extension
-
stackedWith(
List< Widget> children, {AlignmentGeometry alignment = Alignment.topLeft, StackFit fit = StackFit.loose, Clip clipBehavior = Clip.hardEdge}) → Widget -
Available on Widget, provided by the WidgetStackExtensions extension
Wraps the widget in a Stack with otherchildren -
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
-
visible(
bool visible) → Widget -
Available on Widget, provided by the VisibilityWidget extension
-
withAnimatedOpacity(
{required double opacity, required Duration duration, required Curve curve}) → Widget -
Available on Widget, provided by the AnimatedOpacityWidget extension
-
withBorderRadius(
BorderRadius borderRadius) → Widget -
Available on Widget, provided by the BorderRadiusWidget extension
-
withBoxShadow(
{Color color = Colors.black, double offsetX = 0.0, double offsetY = 2.0, double blurRadius = 6.0}) → Widget -
Available on Widget, provided by the ShadowWidget extension
-
withDecoration(
BoxDecoration decoration) → Widget -
Available on Widget, provided by the DecorationWidget extension
-
withMargin(
EdgeInsetsGeometry margin) → Widget -
Available on Widget, provided by the MarginWidget extension
-
withPadding(
EdgeInsetsGeometry padding) → Widget -
Available on Widget, provided by the PaddingWidget extension
-
withShape(
ShapeBorder shape) → Widget -
Available on Widget, provided by the ShapeWidget extension
-
withTooltip(
String message) → Widget -
Available on Widget, provided by the TooltipWidget extension
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- noMaxLength → const int
- Constant representing no maximum length for the input.