UnifiedBaseTextField class
Lean Cupertino-styled field: label (column or row), editable area, optional inline error.
Owns an internal TextEditingController only when controller is omitted.
Replaces legacy AppTextFormField for unified inputs — no numeric sheet / riverpod here.
Form-like behavior without FormField (optional):
- errorText: parent-driven message (API / cross-field); non-empty wins over validator.
- autovalidateMode: when to run validator (
null= AutovalidateMode.always, same as before). - onSaved: invoked from UnifiedBaseTextFieldState.save (e.g. submit flow).
- UnifiedBaseTextFieldState.validate / UnifiedBaseTextFieldState.save via
GlobalKey<UnifiedBaseTextFieldState>.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- UnifiedBaseTextField
Constructors
-
UnifiedBaseTextField({Key? key, TextEditingController? controller, FocusNode? focusNode, String? initialValue, String? label, String? placeholder, TextStyle? labelStyle, EdgeInsetsGeometry? labelPadding, TextStyle? style, TextStyle? placeholderStyle, Color? backgroundColor, Color? headerBackgroundColor, BorderRadius? borderRadius, BorderSide? borderSide, double? height, EdgeInsetsGeometry? padding, TextInputType? keyboardType, TextInputAction? textInputAction, TextCapitalization textCapitalization = TextCapitalization.none, TextAlign textAlign = TextAlign.start, List<
TextInputFormatter> ? inputFormatters, int? maxLines = 1, int? minLines, int? maxLength, bool readOnly = false, bool disabled = false, bool isDisabled = false, bool locked = false, bool loading = false, bool interactionBlocked = false, bool? resetTextWhenLocked, bool autofocus = false, bool? selectTextOnFocus, bool isPassword = false, bool? showClearButton, bool requiredField = false, bool? labelInRow, UnifiedFieldLabelMode? labelMode, List<int> ? rowLabelRatio, String? errorText, AutovalidateMode? autovalidateMode, String? validator(String value)?, ValueChanged<String> ? onSaved, bool? showError, Color? validationColor, IconData? validationIcon, Widget? prefix, Widget? prefixIcon, Widget? suffixIcon, ValueChanged<String> ? onChanged, ValueChanged<String> ? onSubmit, bool? mustResolveTextDirectionByInput, UnifiedInputDecorationSet? decorationSet, UnifiedInputBrightness? brightness, UnifiedFieldsCalendarKind? digitCalendarKind}) -
Creates the base text field used by every unified input widget.
const
Properties
- autofocus → bool
-
Whether the inner field should request focus on first build.
final
- autovalidateMode → AutovalidateMode?
-
When validator runs for UI feedback.
nullmeans AutovalidateMode.always.final - backgroundColor → Color?
-
Background color of the editing area (
null→ theme / palette).final - borderRadius → BorderRadius?
-
Border radius of the field box (
null→ theme / palette).final - borderSide → BorderSide?
-
Border side of the field box (
null→ theme / palette).final - brightness → UnifiedInputBrightness?
-
Brightness used when resolving decorationSet (and when decorationSet is null, ignored).
final
- controller → TextEditingController?
-
External TextEditingController; if null one is created internally.
final
- decorationSet → UnifiedInputDecorationSet?
-
Per-state decorations (focus, error, valid, locked, disabled, …). Merged with brightness palette defaults.
final
- digitCalendarKind → UnifiedFieldsCalendarKind?
-
Calendar kind for Persian digit / UnifiedInputFieldDefaults.textStylePersian selection.
final
- disabled → bool
-
When true, the field is non-editable and visually muted.
final
- errorText → String?
-
Imperative / server-side error; non-empty trim wins over validator for display.
final
- focusNode → FocusNode?
-
External focus node; if null one is created internally.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- headerBackgroundColor → Color?
-
Background of the left label area when labelInRow is true.
final
- height → double?
-
Minimum height of the inner row.
final
- initialValue → String?
-
Initial text when controller is null.
final
-
inputFormatters
→ List<
TextInputFormatter> ? -
Custom input formatters applied to user keystrokes.
final
- interactionBlocked → bool
-
When true, blocks focus and direct edits without changing colors or
suffix state icons. Use for pick-only fields (date, async picker) where
a parent GestureDetector opens the sheet.
final
- isDisabled → bool
-
When true, greys out the label and shows a forbid icon in the suffix.
Unlike locked, which uses a lock icon. Either state blocks editing.
final
- isPassword → bool
-
Render entered text as obscured and add a visibility toggle.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardType → TextInputType?
-
Keyboard type.
final
- label → String?
-
Label rendered above (or beside) the editing area.
final
- labelInRow → bool?
-
Render the label in the same row as the editing area (
null→ theme / labelMode).final - labelMode → UnifiedFieldLabelMode?
-
Label placement; when null, labelInRow maps to UnifiedFieldLabelMode.labelInRow,
otherwise defaults to UnifiedFieldLabelMode.floatingLabel.
final
- labelPadding → EdgeInsetsGeometry?
-
Override for label padding (interpretation depends on labelMode).
final
- labelStyle → TextStyle?
-
Override for the label text style.
final
- loading → bool
-
When true, shows a small loading spinner in the suffix (instead of
suffixIcon) and blocks focus/edits without muted disabled chrome.
final
- locked → bool
-
When true, paints the field in "locked" style with a lock suffix icon.
final
- maxLength → int?
-
Maximum allowed characters.
final
- maxLines → int?
-
Maximum visible lines.
final
- minLines → int?
-
Minimum visible lines.
final
- mustResolveTextDirectionByInput → bool?
-
If true, the text direction is inferred from the typed content (
null→ theme).final -
onChanged
→ ValueChanged<
String> ? -
Called on every keystroke.
final
-
onSaved
→ ValueChanged<
String> ? -
Called from UnifiedBaseTextFieldState.save.
final
-
onSubmit
→ ValueChanged<
String> ? -
Called when the user submits via the keyboard action button.
final
- padding → EdgeInsetsGeometry?
-
Inner content padding.
final
- placeholder → String?
-
Placeholder / hint text shown when empty.
final
- placeholderStyle → TextStyle?
-
Override for placeholder / hint text (
null→ theme / UnifiedInputDecoration).final - prefix → Widget?
-
Leading widget shown before the field content.
final
- prefixIcon → Widget?
-
Leading icon shown before the field content.
final
- readOnly → bool
-
When true, the inner field rejects edits.
final
- requiredField → bool
-
Render the required marker next to label.
final
- resetTextWhenLocked → bool?
-
Whether to reset to initialValue when locked becomes true (
null→ theme).final -
rowLabelRatio
→ List<
int> ? -
Flex ratio between the label cell and the body cell when labelInRow is true.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectTextOnFocus → bool?
-
When true, focusing a non-empty editable field selects all text so typing
replaces the current value (
null→ UnifiedInputFieldDefaults / theme).final - showClearButton → bool?
-
Show an "x" suffix to clear the field when it has content (
null→ theme).final - showError → bool?
-
Whether to render the inline error strip below the field when present (
null→ theme).final - style → TextStyle?
-
Override for the editing text style.
final
- suffixIcon → Widget?
-
Trailing widget shown after the field content.
final
- textAlign → TextAlign
-
Horizontal alignment of typed text.
final
- textCapitalization → TextCapitalization
-
Capitalization rule applied to typed text.
final
- textInputAction → TextInputAction?
-
Keyboard action button.
final
- validationColor → Color?
-
Color used for error chrome (border, label).
final
- validationIcon → IconData?
-
Optional icon shown in the inline error strip.
final
- validator → String? Function(String value)?
-
Synchronous validator returning the error message, or null when valid.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< UnifiedBaseTextField> -
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