AppTextField constructor
const
AppTextField({
- Key? key,
- TextEditingController? controller,
- FocusNode? focusNode,
- void onChanged()?,
- void onSubmitted()?,
- VoidCallback? onTap,
- VoidCallback? onEditingComplete,
- void onSaved()?,
- String? validator()?,
- void onFocusChanged()?,
- TextFieldStyle fieldStyle = TextFieldStyle.outlined,
- LabelPosition labelPosition = LabelPosition.above,
- String? label,
- String? hint,
- String? helperText,
- String? errorText,
- String? counterText,
- String? prefixText,
- String? suffixText,
- double? height,
- double? width,
- EdgeInsetsGeometry? contentPadding,
- double? borderRadius,
- double? borderWidth,
- double? labelSpacing,
- Color? backgroundColor,
- Color? focusedBackgroundColor,
- Color? disabledBackgroundColor,
- Color? borderColor,
- Color? focusedBorderColor,
- Color? errorBorderColor,
- Color? textColor,
- Color? hintColor,
- Color? labelColor,
- Color? errorColor,
- Color? cursorColor,
- Color? iconColor,
- Color? focusedIconColor,
- Color? prefixTextColor,
- Color? suffixTextColor,
- double? fontSize,
- FontWeight? fontWeight,
- String? fontFamily,
- double? labelFontSize,
- FontWeight? labelFontWeight,
- double? hintFontSize,
- TextStyle? textStyle,
- TextStyle? labelStyle,
- TextStyle? hintStyle,
- TextStyle? errorStyle,
- TextStyle? helperStyle,
- TextStyle? counterStyle,
- Widget? prefixIcon,
- Widget? suffixIcon,
- IconData? prefixIconData,
- IconData? suffixIconData,
- double? prefixIconSize,
- double? suffixIconSize,
- Color? prefixIconColor,
- Color? suffixIconColor,
- TextInputType? keyboardType,
- TextInputAction? textInputAction,
- TextCapitalization textCapitalization = TextCapitalization.none,
- bool autofocus = false,
- bool readOnly = false,
- bool enabled = true,
- bool enableSuggestions = true,
- bool autocorrect = true,
- bool? showCursor,
- bool obscureText = false,
- String obscuringCharacter = '•',
- bool showPasswordToggle = false,
- Widget? passwordVisibleIcon,
- Widget? passwordHiddenIcon,
- int? maxLength,
- int? maxLines = 1,
- int? minLines,
- bool expands = false,
- bool showCounter = false,
- List<
TextInputFormatter> ? inputFormatters, - Iterable<
String> ? autofillHints, - AutovalidateMode? autovalidateMode,
- bool isRequired = false,
- Color? requiredIndicatorColor,
- bool isLoading = false,
- Widget? loadingWidget,
- String? semanticsLabel,
- bool? enableSecurity,
Implementation
const AppTextField({
super.key,
// ============== Controllers & Focus ==============
this.controller,
this.focusNode,
// ============== Callbacks ==============
this.onChanged,
this.onSubmitted,
this.onTap,
this.onEditingComplete,
this.onSaved,
this.validator,
this.onFocusChanged,
// ============== Style Configuration ==============
this.fieldStyle = TextFieldStyle.outlined,
this.labelPosition = LabelPosition.above,
// ============== Text Configuration ==============
this.label,
this.hint,
this.helperText,
this.errorText,
this.counterText,
this.prefixText,
this.suffixText,
// ============== Size Configuration ==============
this.height,
this.width,
this.contentPadding,
this.borderRadius,
this.borderWidth,
this.labelSpacing,
// ============== Color Configuration ==============
this.backgroundColor,
this.focusedBackgroundColor,
this.disabledBackgroundColor,
this.borderColor,
this.focusedBorderColor,
this.errorBorderColor,
this.textColor,
this.hintColor,
this.labelColor,
this.errorColor,
this.cursorColor,
this.iconColor,
this.focusedIconColor,
this.prefixTextColor,
this.suffixTextColor,
// ============== Typography Configuration ==============
this.fontSize,
this.fontWeight,
this.fontFamily,
this.labelFontSize,
this.labelFontWeight,
this.hintFontSize,
this.textStyle,
this.labelStyle,
this.hintStyle,
this.errorStyle,
this.helperStyle,
this.counterStyle,
// ============== Icon Configuration ==============
this.prefixIcon,
this.suffixIcon,
this.prefixIconData,
this.suffixIconData,
this.prefixIconSize,
this.suffixIconSize,
this.prefixIconColor,
this.suffixIconColor,
// ============== Keyboard Configuration ==============
this.keyboardType,
this.textInputAction,
this.textCapitalization = TextCapitalization.none,
this.autofocus = false,
this.readOnly = false,
this.enabled = true,
this.enableSuggestions = true,
this.autocorrect = true,
this.showCursor,
// ============== Password Configuration ==============
this.obscureText = false,
this.obscuringCharacter = '•',
this.showPasswordToggle = false,
this.passwordVisibleIcon,
this.passwordHiddenIcon,
// ============== Input Configuration ==============
this.maxLength,
this.maxLines = 1,
this.minLines,
this.expands = false,
this.showCounter = false,
this.inputFormatters,
this.autofillHints,
// ============== Validation Configuration ==============
this.autovalidateMode,
this.isRequired = false,
this.requiredIndicatorColor,
// ============== State Configuration ==============
this.isLoading = false,
this.loadingWidget,
// ============== Accessibility ==============
this.semanticsLabel,
// ============== Security ==============
this.enableSecurity,
});