FancyFormField class
A custom form field widget that integrates with a form manager and offers various configurable input properties.
The FancyFormField
widget allows you to customize the behavior and appearance of a text input field,
including validation, input formatting, and styling.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- FancyFormField
Constructors
-
FancyFormField({Key? key, required FancyKey fancyKey, AutovalidateMode? autovalidateMode, TextEditingController? controller, bool? enabled, String? forceErrorText, String? initialValue, ValueChanged<
String> ? onChanged, FormFieldSetter<String> ? onSaved, String? restorationId, FormFieldValidator<String> ? validator, FocusNode? focusNode, InputDecoration? decoration, TextInputType? keyboardType, TextCapitalization textCapitalization = TextCapitalization.none, TextInputAction? textInputAction, TextStyle? style, StrutStyle? strutStyle, TextDirection? textDirection, TextAlign textAlign = TextAlign.start, TextAlignVertical? textAlignVertical, bool autofocus = false, bool readOnly = false, bool? showCursor, String obscuringCharacter = '•', bool obscureText = false, bool autocorrect = true, List<TextInputFormatter> ? inputFormatters, bool enableSuggestions = true, int? maxLines = 1, int? minLines, bool expands = false, int? maxLength, GestureTapCallback? onTap, bool onTapAlwaysCalled = false, TapRegionCallback? onTapOutside, VoidCallback? onEditingComplete, ValueChanged<String> ? onFieldSubmitted, ScrollPhysics? scrollPhysics, ScrollController? scrollController, double cursorWidth = 2.0, double? cursorHeight, Radius? cursorRadius, Color? cursorColor, Color? cursorErrorColor, Brightness? keyboardAppearance, EdgeInsets scrollPadding = const EdgeInsets.all(20.0), bool enableIMEPersonalizedLearning = true, bool? enableInteractiveSelection, Clip clipBehavior = Clip.hardEdge}) -
const
Properties
- autocorrect → bool
-
Whether autocorrection is enabled for the field.
final
- autofocus → bool
-
Whether the field should autofocus when the widget is built.
final
- autovalidateMode → AutovalidateMode?
-
Controls the validation and auto-validation mode for the field.
final
- clipBehavior → Clip
-
The clipping behavior for the input field.
final
- controller → TextEditingController?
-
The controller for the text input field.
final
- cursorColor → Color?
-
The color of the cursor in the input field.
final
- cursorErrorColor → Color?
-
The color of the cursor when an error occurs.
final
- cursorHeight → double?
-
The height of the cursor in the input field.
final
- cursorRadius → Radius?
-
The radius of the cursor.
final
- cursorWidth → double
-
The width of the cursor in the input field.
final
- decoration → InputDecoration?
-
The decoration for the input field, such as label, hint, and icon.
final
- enabled → bool?
-
Whether the field is enabled or not.
final
- enableIMEPersonalizedLearning → bool
-
Whether to enable personalized learning for the IME (Input Method Editor).
final
- enableInteractiveSelection → bool?
-
Whether to allow interactive selection of the text in the input field.
final
- enableSuggestions → bool
-
Whether suggestions (e.g., predictive text) are enabled.
final
- expands → bool
-
Whether the input should expand to fill the available space.
final
- fancyKey → FancyKey
-
A unique key to identify this field in the form.
final
- focusNode → FocusNode?
-
A node that can be used to manage the focus state of the input field.
final
- forceErrorText → String?
-
A forced error message to display instead of the default error messages.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialValue → String?
-
The initial value of the field.
final
-
inputFormatters
→ List<
TextInputFormatter> ? -
A list of input formatters to apply to the input field.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardAppearance → Brightness?
-
The appearance mode of the keyboard (e.g., light or dark).
final
- keyboardType → TextInputType?
-
The keyboard type (e.g., text, number, email).
final
- maxLength → int?
-
The maximum length of the input.
final
- maxLines → int?
-
The maximum number of lines that the input can occupy.
final
- minLines → int?
-
The minimum number of lines that the input can occupy.
final
- obscureText → bool
-
Whether the field obscures the text (typically used for passwords).
final
- obscuringCharacter → String
-
The character to obscure the text when
obscureText
is enabled (e.g.,•
).final -
onChanged
→ ValueChanged<
String> ? -
A callback that is invoked when the field value changes.
final
- onEditingComplete → VoidCallback?
-
A callback that is triggered when editing is complete.
final
-
onFieldSubmitted
→ ValueChanged<
String> ? -
A callback that is triggered when the field value is submitted.
final
-
onSaved
→ FormFieldSetter<
String> ? -
A callback that is invoked when the form is saved.
final
- onTap → GestureTapCallback?
-
A callback that is triggered when the input field is tapped.
final
- onTapAlwaysCalled → bool
-
Whether the
onTap
callback should always be called.final - onTapOutside → TapRegionCallback?
-
A callback that is triggered when tapping outside of the field.
final
- readOnly → bool
-
Whether the field is read-only.
final
- restorationId → String?
-
The restoration ID used to restore the state of the field.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController → ScrollController?
-
The controller for the scrollable area of the field.
final
- scrollPadding → EdgeInsets
-
The padding for the scrollable area of the field.
final
- scrollPhysics → ScrollPhysics?
-
The scroll physics to apply to the field's scrollable area.
final
- showCursor → bool?
-
Controls whether the cursor is visible in the field.
final
- strutStyle → StrutStyle?
-
The style for the text strut (line height).
final
- style → TextStyle?
-
The text style for the input field.
final
- textAlign → TextAlign
-
The alignment of the text within the field (e.g., left, right, center).
final
- textAlignVertical → TextAlignVertical?
-
The vertical alignment of the text within the field.
final
- textCapitalization → TextCapitalization
-
Controls text capitalization behavior for the field (e.g., none, sentences, words).
final
- textDirection → TextDirection?
-
The text direction for the input field (e.g., left-to-right, right-to-left).
final
- textInputAction → TextInputAction?
-
The action button on the keyboard (e.g., next, done).
final
-
validator
→ FormFieldValidator<
String> ? -
A validator function that validates the field input.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< FancyFormField> -
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