GrxTextField constructor
GrxTextField({
- Key? key,
- bool readOnly = false,
- TextInputType? keyboardType,
- bool obscureText = false,
- ValueChanged<
String> ? onSubmitted, - FocusNode? focusNode,
- bool autofocus = false,
- List<
TextInputFormatter> ? inputFormatters, - GestureTapCallback? onTap,
- ValueChanged<
String> ? onChanged, - Iterable<
String> ? autofillHints = const <String>[], - required TextEditingController controller,
- String? labelText,
- bool enabled = true,
- bool? autocorrect = false,
- EdgeInsets? contentPadding,
- TextCapitalization textCapitalization = TextCapitalization.sentences,
- TextAlignVertical textAlignVertical = TextAlignVertical.center,
- int? maxLines = 1,
- bool alignLabelWithHint = false,
- String? hintText,
- int? hintMaxLines,
- String? errorText,
- TextInputAction textInputAction = TextInputAction.next,
- void onClear()?,
- bool showClearButton = true,
- Widget? prefix,
- Widget? suffix,
- TextStyle? style,
- BoxConstraints? suffixIconConstraints,
Implementation
GrxTextField({
super.key,
super.readOnly,
super.keyboardType,
super.obscureText,
super.onSubmitted,
super.focusNode,
super.autofocus,
super.inputFormatters,
super.onTap,
super.onChanged,
super.autofillHints,
required TextEditingController super.controller,
final String? labelText,
final bool enabled = true,
super.autocorrect = false,
final EdgeInsets? contentPadding,
super.textCapitalization = TextCapitalization.sentences,
TextAlignVertical super.textAlignVertical = TextAlignVertical.center,
final int? maxLines = 1,
final bool alignLabelWithHint = false,
final String? hintText,
final int? hintMaxLines,
final String? errorText,
TextInputAction super.textInputAction = TextInputAction.next,
final void Function()? onClear,
final bool showClearButton = true,
final Widget? prefix,
final Widget? suffix,
final TextStyle? style,
final BoxConstraints? suffixIconConstraints,
}) : super(
cursorColor: GrxColors.primary.shade900,
style: style ?? GrxLabelLargeTextStyle(),
maxLines: obscureText ? 1 : maxLines,
decoration: GrxInputDecoration(
labelText: labelText,
alignLabelWithHint: alignLabelWithHint,
contentPadding: contentPadding,
hintText: hintText,
hintMaxLines: hintMaxLines,
errorText: errorText,
enabled: enabled,
onClear: onClear?.call ?? controller.clear,
showClearButton:
showClearButton && controller.text.isNotEmpty && enabled,
prefix: prefix,
suffix: suffix,
suffixIconConstraints: suffixIconConstraints,
),
);