GFTextField constructor
GFTextField({
- Key? key,
- TextEditingController? controller,
- String? fieldinitialValue,
- FocusNode? focusNode,
- InputDecoration? decoration,
- TextInputType? keyboardType = TextInputType.text,
- TextCapitalization textCapitalization = TextCapitalization.none,
- TextInputAction? textInputAction,
- TextStyle? style = const TextStyle(),
- StrutStyle? strutStyle = const StrutStyle(),
- TextDirection? textDirection = TextDirection.ltr,
- TextAlign? textAlign = TextAlign.start,
- TextAlignVertical? textAlignVertical = TextAlignVertical.center,
- bool autofocus = false,
- bool? readOnly = false,
- bool? showCursor,
- String obscuringCharacter = '.',
- bool obscureText = false,
- bool autocorrect = true,
- SmartDashesType? smartDashesType,
- SmartQuotesType? smartQuotesType,
- bool enableSuggestions = true,
- bool? autovalidate = true,
- MaxLengthEnforcement maxLengthEnforced = MaxLengthEnforcement.none,
- int? maxLines = 1,
- int? minLines = 1,
- bool expands = false,
- int? maxLength,
- ValueChanged<
String> ? onChanged, - GestureTapCallback? onTap,
- VoidCallback? onEditingComplete,
- ValueChanged<
String> ? onFieldSubmitted, - FormFieldSetter<
String> ? onfieldSaved, - FormFieldValidator<
String> ? validatornew, - List<
TextInputFormatter> ? inputFormatters, - bool fieldEnabled = true,
- double? cursorWidth = 2.0,
- double? cursorHeight,
- Radius? cursorRadius,
- Color? cursorColor,
- Color? color,
- Radius? borderradius,
- Brightness? keyboardAppearance,
- EdgeInsets scrollPadding = const EdgeInsets.all(20),
- bool enableInteractiveSelection = true,
- InputCounterWidgetBuilder? buildCounter,
- ScrollPhysics? scrollPhysics,
- Iterable<
String> ? autofillHints, - AutovalidateMode autoValidateMode = AutovalidateMode.disabled,
Implementation
GFTextField(
{Key? key,
this.controller,
this.fieldinitialValue,
this.focusNode,
this.decoration,
this.keyboardType = TextInputType.text,
this.textCapitalization = TextCapitalization.none,
this.textInputAction,
this.style = const TextStyle(),
this.strutStyle = const StrutStyle(),
this.textDirection = TextDirection.ltr,
this.textAlign = TextAlign.start,
this.textAlignVertical = TextAlignVertical.center,
this.autofocus = false,
this.readOnly = false,
this.showCursor,
this.obscuringCharacter = '.',
this.obscureText = false,
this.autocorrect = true,
this.smartDashesType,
this.smartQuotesType,
this.enableSuggestions = true,
this.autovalidate = true,
this.maxLengthEnforced = MaxLengthEnforcement.none,
this.maxLines = 1,
this.minLines = 1,
this.expands = false,
this.maxLength,
this.onChanged,
this.onTap,
this.onEditingComplete,
this.onFieldSubmitted,
this.onfieldSaved,
this.validatornew,
this.inputFormatters,
this.fieldEnabled = true,
this.cursorWidth = 2.0,
this.cursorHeight,
this.cursorRadius,
this.cursorColor,
this.color,
this.borderradius,
this.keyboardAppearance,
this.scrollPadding = const EdgeInsets.all(20),
this.enableInteractiveSelection = true,
this.buildCounter,
this.scrollPhysics,
this.autofillHints,
this.autoValidateMode = AutovalidateMode.disabled})
: super(
key: key,
builder: (FormFieldState<String> field) => _GfTextFieldState(
state: field,
controller: controller,
focusNode: focusNode,
decoration: decoration,
keyboardType: keyboardType,
textInputAction: textInputAction,
style: style,
strutStyle: strutStyle,
initialValuex: fieldinitialValue ?? '',
autovalidate: autovalidate,
onSavedx: onfieldSaved,
validator: validatornew,
color: color,
borderradius: borderradius,
autoValidateMode: autoValidateMode,
textAlign: textAlign ?? TextAlign.start,
textAlignVertical: textAlignVertical,
textDirection: textDirection,
textCapitalization: textCapitalization,
autofocus: autofocus,
readOnly: readOnly ?? false,
showCursor: showCursor,
obscuringCharacter: obscuringCharacter,
obscureText: obscureText,
autocorrect: autocorrect,
smartDashesType: smartDashesType ??
(obscureText
? SmartDashesType.disabled
: SmartDashesType.enabled),
smartQuotesType: smartQuotesType ??
(obscureText
? SmartQuotesType.disabled
: SmartQuotesType.enabled),
enableSuggestions: enableSuggestions,
maxLengthEnforced: maxLengthEnforced,
maxLines: maxLines,
minLines: minLines,
expands: (maxLines == null && minLines == null) || false,
maxLength: maxLength,
onChanged: onChanged,
onTap: onTap,
onEditingComplete: onEditingComplete,
onFieldSubmitted: onFieldSubmitted,
inputFormatters: inputFormatters,
enabled: fieldEnabled,
cursorWidth: cursorWidth ?? 1,
cursorHeight: cursorHeight,
cursorRadius: cursorRadius,
cursorColor: cursorColor,
scrollPadding: scrollPadding,
scrollPhysics: scrollPhysics,
keyboardAppearance: keyboardAppearance,
enableInteractiveSelection: enableInteractiveSelection,
buildCounter: buildCounter,
autofillHints: autofillHints,
));