GFTextField constructor
GFTextField({
- Key? key,
- TextEditingController? controller,
- String? initialValue,
- 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,
- ToolbarOptions? toolbarOptions = const ToolbarOptions(copy: true, cut: true, paste: true, selectAll: true),
- 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> ? onSaved, - FormFieldValidator<
String> ? validator, - List<
TextInputFormatter> ? inputFormatters, - bool enabled = 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.initialValue,
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.toolbarOptions=const ToolbarOptions(copy: true,cut: true,paste: true,selectAll: true),
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.onSaved,
this.validator,
this.inputFormatters,
this.enabled=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: initialValue??'',
autovalidate: autovalidate,
onSavedx: onSaved,
validator: validator,
color: color,
borderradius: borderradius,
autovalidateMode: autovalidateMode,
textAlign: textAlign??TextAlign.start,
textAlignVertical: textAlignVertical,
textDirection: textDirection,
textCapitalization: textCapitalization,
autofocus: autofocus,
toolbarOptions: toolbarOptions,
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: enabled,
cursorWidth: cursorWidth??1,
cursorHeight: cursorHeight,
cursorRadius: cursorRadius,
cursorColor: cursorColor,
scrollPadding: scrollPadding,
scrollPhysics: scrollPhysics,
keyboardAppearance: keyboardAppearance,
enableInteractiveSelection: enableInteractiveSelection,
buildCounter: buildCounter,
autofillHints: autofillHints,
)
);