FormeCupertinoTextField constructor

FormeCupertinoTextField({
  1. String? initialValue,
  2. required String name,
  3. bool readOnly = false,
  4. Key? key,
  5. int? maxLines = 1,
  6. int? order,
  7. BoxDecoration? decoration = defaultTextFieldDecoration,
  8. EdgeInsetsGeometry padding = const EdgeInsets.all(6.0),
  9. String? placeholder,
  10. TextStyle placeholderStyle = const TextStyle(fontWeight: FontWeight.w400, color: CupertinoColors.placeholderText),
  11. Widget? prefix,
  12. OverlayVisibilityMode prefixMode = OverlayVisibilityMode.always,
  13. Widget? suffix,
  14. OverlayVisibilityMode suffixMode = OverlayVisibilityMode.always,
  15. OverlayVisibilityMode clearButtonMode = OverlayVisibilityMode.never,
  16. TextInputType? keyboardType,
  17. TextInputAction? textInputAction,
  18. TextCapitalization textCapitalization = TextCapitalization.none,
  19. TextStyle? style,
  20. StrutStyle? strutStyle,
  21. TextAlign textAlign = TextAlign.start,
  22. ToolbarOptions? toolbarOptions,
  23. TextAlignVertical? textAlignVertical,
  24. bool? showCursor,
  25. bool autofocus = false,
  26. String obscuringCharacter = '•',
  27. bool obscureText = false,
  28. bool autocorrect = true,
  29. SmartDashesType? smartDashesType,
  30. SmartQuotesType? smartQuotesType,
  31. bool enableSuggestions = true,
  32. int? minLines,
  33. bool expands = false,
  34. int? maxLength,
  35. MaxLengthEnforcement? maxLengthEnforcement,
  36. VoidCallback? onEditingComplete,
  37. ValueChanged<String>? onSubmitted,
  38. List<TextInputFormatter>? inputFormatters,
  39. bool enabled = true,
  40. double cursorWidth = 2.0,
  41. double? cursorHeight,
  42. Radius cursorRadius = const Radius.circular(2.0),
  43. Color? cursorColor,
  44. BoxHeightStyle selectionHeightStyle = BoxHeightStyle.tight,
  45. BoxWidthStyle selectionWidthStyle = BoxWidthStyle.tight,
  46. Brightness? keyboardAppearance,
  47. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  48. bool enableInteractiveSelection = true,
  49. TextSelectionControls? selectionControls,
  50. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  51. ScrollController? scrollController,
  52. ScrollPhysics? scrollPhysics,
  53. GestureTapCallback? onTap,
  54. Iterable<String>? autofillHints,
  55. bool borderless = false,
  56. bool quietlyValidate = false,
  57. Duration? asyncValidatorDebounce,
  58. AutovalidateMode? autovalidateMode,
  59. FormeFieldStatusChanged<String>? onStatusChanged,
  60. dynamic onInitialed,
  61. FormeFieldSetter<String>? onSaved,
  62. FormeValidator<String>? validator,
  63. FormeAsyncValidator<String>? asyncValidator,
  64. FormeFieldDecorator<String>? decorator,
  65. bool enableIMEPersonalizedLearning = true,
  66. bool registrable = true,
  67. bool updateValueWhenComposing = false,
  68. FormeFieldValidationFilter<String>? validationFilter,
  69. FocusNode? focusNode,
})

Implementation

FormeCupertinoTextField({
  String? initialValue,
  required String name,
  bool readOnly = false,
  Key? key,
  int? maxLines = 1,
  int? order,
  BoxDecoration? decoration = defaultTextFieldDecoration,
  EdgeInsetsGeometry padding = const EdgeInsets.all(6.0),
  String? placeholder,
  TextStyle placeholderStyle = const TextStyle(
    fontWeight: FontWeight.w400,
    color: CupertinoColors.placeholderText,
  ),
  Widget? prefix,
  OverlayVisibilityMode prefixMode = OverlayVisibilityMode.always,
  Widget? suffix,
  OverlayVisibilityMode suffixMode = OverlayVisibilityMode.always,
  OverlayVisibilityMode clearButtonMode = OverlayVisibilityMode.never,
  TextInputType? keyboardType,
  TextInputAction? textInputAction,
  TextCapitalization textCapitalization = TextCapitalization.none,
  TextStyle? style,
  StrutStyle? strutStyle,
  TextAlign textAlign = TextAlign.start,
  ToolbarOptions? toolbarOptions,
  TextAlignVertical? textAlignVertical,
  bool? showCursor,
  bool autofocus = false,
  String obscuringCharacter = '•',
  bool obscureText = false,
  bool autocorrect = true,
  SmartDashesType? smartDashesType,
  SmartQuotesType? smartQuotesType,
  bool enableSuggestions = true,
  int? minLines,
  bool expands = false,
  int? maxLength,
  MaxLengthEnforcement? maxLengthEnforcement,
  VoidCallback? onEditingComplete,
  ValueChanged<String>? onSubmitted,
  List<TextInputFormatter>? inputFormatters,
  bool enabled = true,
  double cursorWidth = 2.0,
  double? cursorHeight,
  Radius cursorRadius = const Radius.circular(2.0),
  Color? cursorColor,
  BoxHeightStyle selectionHeightStyle = BoxHeightStyle.tight,
  BoxWidthStyle selectionWidthStyle = BoxWidthStyle.tight,
  Brightness? keyboardAppearance,
  EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  bool enableInteractiveSelection = true,
  TextSelectionControls? selectionControls,
  DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  ScrollController? scrollController,
  ScrollPhysics? scrollPhysics,
  GestureTapCallback? onTap,
  Iterable<String>? autofillHints,
  bool borderless = false,
  bool quietlyValidate = false,
  Duration? asyncValidatorDebounce,
  AutovalidateMode? autovalidateMode,
  FormeFieldStatusChanged<String>? onStatusChanged,
  FormeFieldInitialed<String>? onInitialed,
  FormeFieldSetter<String>? onSaved,
  FormeValidator<String>? validator,
  FormeAsyncValidator<String>? asyncValidator,
  FormeFieldDecorator<String>? decorator,
  bool enableIMEPersonalizedLearning = true,
  bool registrable = true,
  this.updateValueWhenComposing = false,
  FormeFieldValidationFilter<String>? validationFilter,
  FocusNode? focusNode,
}) : super(
          focusNode: focusNode,
          validationFilter: validationFilter,
          registrable: registrable,
          enabled: enabled,
          decorator: decorator,
          quietlyValidate: quietlyValidate,
          asyncValidatorDebounce: asyncValidatorDebounce,
          autovalidateMode: autovalidateMode,
          onStatusChanged: onStatusChanged,
          onInitialed: onInitialed,
          onSaved: onSaved,
          validator: validator,
          asyncValidator: asyncValidator,
          order: order,
          key: key,
          name: name,
          readOnly: readOnly,
          initialValue: initialValue ?? '',
          builder: (baseState) {
            final FormeCupertinoTextFieldState state =
                baseState as FormeCupertinoTextFieldState;
            final bool readOnly = state.readOnly;
            final bool enabled = state.enabled;
            final FocusNode focusNode = state.focusNode;
            final TextEditingController textEditingController =
                state.textEditingController;

            return buildCupertinoTextField(
              enabled: enabled,
              enableIMEPersonalizedLearning: enableIMEPersonalizedLearning,
              focusNode: focusNode,
              textEditingController: textEditingController,
              decoration: decoration,
              padding: padding,
              placeholder: placeholder,
              placeholderStyle: placeholderStyle,
              prefix: prefix,
              prefixMode: prefixMode,
              suffix: suffix,
              suffixMode: suffixMode,
              clearButtonMode: clearButtonMode,
              keyboardType: keyboardType,
              textInputAction: textInputAction,
              textCapitalization: textCapitalization,
              style: style,
              strutStyle: strutStyle,
              textAlign: textAlign,
              textAlignVertical: textAlignVertical,
              readOnly: readOnly,
              toolbarOptions: toolbarOptions,
              showCursor: showCursor,
              autofocus: autofocus,
              obscuringCharacter: obscuringCharacter,
              obscureText: obscureText,
              autocorrect: autocorrect,
              smartDashesType: smartDashesType,
              smartQuotesType: smartQuotesType,
              enableSuggestions: enableSuggestions,
              maxLines: maxLines,
              minLines: minLines,
              expands: expands,
              maxLength: maxLength,
              maxLengthEnforcement: updateValueWhenComposing
                  ? maxLengthEnforcement
                  : MaxLengthEnforcement.truncateAfterCompositionEnds,
              // onChanged: state._didChange,
              onEditingComplete: onEditingComplete,
              onSubmitted: onSubmitted,
              inputFormatters: inputFormatters,
              cursorWidth: cursorWidth,
              cursorHeight: cursorHeight,
              cursorRadius: cursorRadius,
              cursorColor: cursorColor,
              selectionHeightStyle: selectionHeightStyle,
              selectionWidthStyle: selectionWidthStyle,
              keyboardAppearance: keyboardAppearance,
              scrollPadding: scrollPadding,
              dragStartBehavior: dragStartBehavior,
              enableInteractiveSelection: enableInteractiveSelection,
              selectionControls: selectionControls,
              onTap: onTap,
              scrollController: scrollController,
              scrollPhysics: scrollPhysics,
              autofillHints: readOnly ? null : autofillHints,
              borderless: borderless,
            );
          });