GFTextField constructor

GFTextField({
  1. Key? key,
  2. TextEditingController? controller,
  3. String? initialValue,
  4. FocusNode? focusNode,
  5. InputDecoration? decoration,
  6. TextInputType? keyboardType = TextInputType.text,
  7. TextCapitalization textCapitalization = TextCapitalization.none,
  8. TextInputAction? textInputAction,
  9. TextStyle? style = const TextStyle(),
  10. StrutStyle? strutStyle = const StrutStyle(),
  11. TextDirection? textDirection = TextDirection.ltr,
  12. TextAlign? textAlign = TextAlign.start,
  13. TextAlignVertical? textAlignVertical = TextAlignVertical.center,
  14. bool autofocus = false,
  15. bool? readOnly = false,
  16. ToolbarOptions? toolbarOptions = const ToolbarOptions(copy: true, cut: true, paste: true, selectAll: true),
  17. bool? showCursor,
  18. String obscuringCharacter = '.',
  19. bool obscureText = false,
  20. bool autocorrect = true,
  21. SmartDashesType? smartDashesType,
  22. SmartQuotesType? smartQuotesType,
  23. bool enableSuggestions = true,
  24. bool? autovalidate = true,
  25. MaxLengthEnforcement maxLengthEnforced = MaxLengthEnforcement.none,
  26. int? maxLines = 1,
  27. int? minLines = 1,
  28. bool expands = false,
  29. int? maxLength,
  30. ValueChanged<String>? onChanged,
  31. GestureTapCallback? onTap,
  32. VoidCallback? onEditingComplete,
  33. ValueChanged<String>? onFieldSubmitted,
  34. FormFieldSetter<String>? onSaved,
  35. FormFieldValidator<String>? validator,
  36. List<TextInputFormatter>? inputFormatters,
  37. bool enabled = true,
  38. double? cursorWidth = 2.0,
  39. double? cursorHeight,
  40. Radius? cursorRadius,
  41. Color? cursorColor,
  42. Color? color,
  43. Radius? borderradius,
  44. Brightness? keyboardAppearance,
  45. EdgeInsets scrollPadding = const EdgeInsets.all(20),
  46. bool enableInteractiveSelection = true,
  47. InputCounterWidgetBuilder? buildCounter,
  48. ScrollPhysics? scrollPhysics,
  49. Iterable<String>? autofillHints,
  50. 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,

  )
    );