UiTextField class
A modern, customizable text field component with extensive styling options and built-in functionality like password visibility toggle.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- UiTextField
- Available extensions
Constructors
-
UiTextField({Key? key, TextEditingController? controller, String? label, String? hintText, bool obscureText = false, bool enableObscureToggle = false, TextInputType keyboardType = TextInputType.text, TextInputAction? textInputAction, Widget? prefixIcon, Widget? suffixIcon, BoxConstraints? prefixIconConstraints, BoxConstraints? suffixIconConstraints, String? validator(String?)?, InputBorder? border, EdgeInsetsGeometry? contentPadding, Color? fillColor, bool filled = true, bool enabled = true, TextStyle? textStyle, TextStyle? hintStyle, TextStyle? labelStyle, TextStyle? errorStyle, TextStyle? helperStyle, FloatingLabelBehavior floatingLabelBehavior = FloatingLabelBehavior.auto, bool autoFocus = false, int? maxLines = 1, int? minLines, List<
TextInputFormatter> ? inputFormatters, String? errorText, String? helperText, FocusNode? focusNode, IconData obscureIcon = Icons.visibility_off, IconData visibleIcon = Icons.visibility, double borderRadius = 12.0, Color borderColor = Colors.grey, double borderWidth = 1.0, UiTextFieldBorder? borderConfig, ValueChanged<String> ? onChanged, VoidCallback? onEditingComplete, ValueChanged<String> ? onSubmitted, GestureTapCallback? onTap, bool autocorrect = true, bool enableSuggestions = true, TextStyle? counterStyle, int? maxLength, bool showCounter = false, Color? cursorColor, double? cursorWidth = 2.0, double? cursorHeight, Radius? cursorRadius, bool enableInteractiveSelection = true, InputCounterWidgetBuilder? buildCounter}) -
Creates a modern, customizable text field
const
Properties
- autocorrect → bool
-
Whether the field should automatically correct input
final
- autoFocus → bool
-
Whether the field should be focused automatically
final
- border → InputBorder?
-
Custom border configuration
final
- borderColor → Color
-
Color of the border
final
- borderConfig → UiTextFieldBorder?
-
Custom border configuration
final
- borderRadius → double
-
Border radius for the text field
final
- borderWidth → double
-
Width of the border
final
- box → Container
-
Available on Widget, provided by the WidgetToBox extension
no setter - buildCounter → InputCounterWidgetBuilder?
-
Build counter widget
final
- contentPadding → EdgeInsetsGeometry?
-
Padding around the content
final
- controller → TextEditingController?
-
Controller for the text field
final
- counterStyle → TextStyle?
-
Style for the counter text
final
- cursorColor → Color?
-
Cursor color
final
- cursorHeight → double?
-
Cursor height
final
- cursorRadius → Radius?
-
Radius of the cursor corners
final
- cursorWidth → double?
-
Cursor width
final
- enabled → bool
-
Whether the text field is enabled
final
- enableInteractiveSelection → bool
-
Selection controls enabled
final
- enableObscureToggle → bool
-
Whether to show toggle button for password visibility
final
- enableSuggestions → bool
-
Whether to enable suggestions
final
- errorStyle → TextStyle?
-
Style for the error text
final
- errorText → String?
-
Custom error text
final
- fillColor → Color?
-
Background color of the text field
final
- filled → bool
-
Whether the text field should be filled with color
final
- floatingLabelBehavior → FloatingLabelBehavior
-
Behavior of the floating label
final
- focusNode → FocusNode?
-
Focus node for the text field
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- helperStyle → TextStyle?
-
Style for the helper text
final
- helperText → String?
-
Helper text displayed below the field
final
- hintStyle → TextStyle?
-
Style for the hint text
final
- hintText → String?
-
Hint text displayed when the field is empty
final
-
inputFormatters
→ List<
TextInputFormatter> ? -
Input formatters for the text
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardType → TextInputType
-
Keyboard type for the text input
final
- label → String?
-
Label text displayed above the field
final
- labelStyle → TextStyle?
-
Style for the label text
final
- maxLength → int?
-
Maximum number of characters allowed
final
- maxLines → int?
-
Maximum number of lines for the input
final
- minLines → int?
-
Minimum number of lines for the input
final
- obscureIcon → IconData
-
Icon for obscured text state
final
- obscureText → bool
-
Whether the text should be obscured (for passwords)
final
-
onChanged
→ ValueChanged<
String> ? -
Callback when the text changes
final
- onEditingComplete → VoidCallback?
-
Callback when editing is complete
final
-
onSubmitted
→ ValueChanged<
String> ? -
Callback when the field is submitted
final
- onTap → GestureTapCallback?
-
Callback when the field is tapped
final
- prefixIcon → Widget?
-
Icon displayed before the input text
final
- prefixIconConstraints → BoxConstraints?
-
Constraints for the prefix icon
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showCounter → bool
-
Whether to show character counter
final
- suffixIcon → Widget?
-
Icon displayed after the input text
final
- suffixIconConstraints → BoxConstraints?
-
Constraints for the suffix icon
final
- textInputAction → TextInputAction?
-
Action button on the keyboard
final
- textStyle → TextStyle?
-
Style for the input text
final
- validator → String? Function(String?)?
-
Validation function for the input
final
- visibleIcon → IconData
-
Icon for visible text state
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< UiTextField> -
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