TextField constructor
const
TextField({
- Key? key,
- TextEditingController? controller,
- String? label,
- String? hint,
- IconData? icon,
- String? prefixText,
- Widget? suffixIcon,
- String? errorText,
- TextInputType? keyboardType,
- TextInputAction? textInputAction,
- bool obscureText = false,
- String obscuringCharacter = '•',
- bool enabled = true,
- bool readOnly = false,
- int maxLines = 1,
- int? minLines,
- int? maxLength,
- String? validator()?,
- ValueChanged<
String> ? onChanged, - ValueChanged<
String> ? onSubmitted, - VoidCallback? onTap,
- FocusNode? focusNode,
- String? initialValue,
- bool autofocus = false,
- Iterable<
String> ? autofillHints, - List<
TextInputFormatter> ? inputFormatters, - TextCapitalization capitalization = TextCapitalization.none,
- AutovalidateMode? autovalidateMode,
- bool filled = true,
- Color? focusBorderColor,
- double borderRadius = AppRadius.medium,
- ValueChanged<
String?> ? onFieldSaved, - TextAlign textAlign = TextAlign.start,
- Color? cursorColor,
- TextStyle? textStyle,
- InputDecoration? decoration,
Implementation
const TextField({
super.key,
this.controller,
this.label,
this.hint,
this.icon,
this.prefixText,
this.suffixIcon,
this.errorText,
this.keyboardType,
this.textInputAction,
this.obscureText = false,
this.obscuringCharacter = '•',
this.enabled = true,
this.readOnly = false,
this.maxLines = 1,
this.minLines,
this.maxLength,
this.validator,
this.onChanged,
this.onSubmitted,
this.onTap,
this.focusNode,
this.initialValue,
this.autofocus = false,
this.autofillHints,
this.inputFormatters,
this.capitalization = TextCapitalization.none,
this.autovalidateMode,
this.filled = true,
this.focusBorderColor,
this.borderRadius = AppRadius.medium,
this.onFieldSaved,
this.textAlign = TextAlign.start,
this.cursorColor,
this.textStyle,
this.decoration,
});