CustomTextForm class

A customizable text input field that supports various properties for flexibility. This widget is designed for forms and provides features such as custom borders, password visibility toggle, input validation, and more.

Inheritance

Constructors

CustomTextForm({Key? key, required TextEditingController controller, bool enableBorder = true, String hintText = "", String labelText = "", Color cursorColor = Colors.green, bool filled = false, Color filledColor = Colors.transparent, TextStyle? hintTextStyle = const TextStyle(color: Colors.black), String obscuringCharacter = "*", bool readOnly = false, bool obscureText = false, TextStyle labelTextStyle = const TextStyle(color: Colors.black), Widget? prefix, Widget? suffix, TextStyle? textStyle, TextInputAction textInputAction = TextInputAction.done, TextInputType keyboardType = TextInputType.text, String? validator(String?)?, Function? onTap, dynamic onChanged(String)?, AutovalidateMode? autovalidateMode = AutovalidateMode.onUserInteraction, List<TextInputFormatter>? inputFormatter, int maxLine = 2, int minLine = 1})
Constructor

Properties

autovalidateMode AutovalidateMode?
The validation mode for the field.
final
controller TextEditingController
TextEditingController to manage the text field's content. It is used to read or modify the text inside the field.
final
cursorColor Color
The cursor color inside the text field.
final
enableBorder bool
Whether to enable borders for the text field.
final
filled bool
Whether the text field should have a background color.
final
filledColor Color
The background color of the text field when filled is true.
final
hashCode int
The hash code for this object.
no setterinherited
hintText String
The hint text displayed when the field is empty.
final
hintTextStyle TextStyle?
The style of the hint text.
final
inputFormatter List<TextInputFormatter>?
A list of input formatters to restrict or modify the input.
getter/setter pair
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardType TextInputType
The type of input (e.g., text, number, email).
getter/setter pair
labelText String
The label text displayed above the field.
final
labelTextStyle TextStyle
The style of the label text.
final
maxLine int
The maximum number of lines the text field can have.
final
minLine int
The minimum number of lines the text field can have.
final
obscureText bool
Whether to obscure the text (e.g., for password fields).
final
obscuringCharacter String
The character used for obscuring text (e.g., "*" for password fields).
final
onChanged ↔ dynamic Function(String)?
A function triggered whenever the text in the field changes.
getter/setter pair
onFieldSubmitted ↔ dynamic Function(String)?
A function triggered when the user submits the text input.
getter/setter pair
onTap Function?
A callback function triggered when the text field is tapped.
final
prefix Widget?
A custom widget to be displayed as a prefix icon.
final
readOnly bool
Whether the text field is read-only.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
suffix Widget?
A custom widget to be displayed as a suffix icon.
final
textInputAction TextInputAction
The action to be taken when the user submits the text.
getter/setter pair
textStyle TextStyle?
The style of the text input itself.
final
validator String? Function(String?)?
A function that validates the text input.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<CustomTextForm>
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