FormeCupertinoTextField constructor

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

Implementation

FormeCupertinoTextField({
  super.key,
  super.name,
  super.initialValue = '',
  super.asyncValidator,
  super.asyncValidatorDebounce,
  super.autovalidateMode,
  super.decorator,
  super.enabled = true,
  super.focusNode,
  super.onInitialized,
  super.onSaved,
  super.onStatusChanged,
  super.order,
  super.quietlyValidate = false,
  super.readOnly = false,
  super.requestFocusOnUserInteraction = true,
  super.validationFilter,
  super.validator,
  this.decoration = _kDefaultRoundedBorderDecoration,
  this.padding = const EdgeInsets.all(7.0),
  this.placeholder,
  this.placeholderStyle = const TextStyle(
    fontWeight: FontWeight.w400,
    color: CupertinoColors.placeholderText,
  ),
  this.prefix,
  this.prefixMode = OverlayVisibilityMode.always,
  this.suffix,
  this.suffixMode = OverlayVisibilityMode.always,
  this.clearButtonMode = OverlayVisibilityMode.never,
  this.keyboardType,
  this.textInputAction,
  this.textCapitalization = TextCapitalization.none,
  this.style,
  this.strutStyle,
  this.textAlign = TextAlign.start,
  this.textAlignVertical,
  this.showCursor,
  this.autofocus = false,
  this.obscuringCharacter = '•',
  this.obscureText = false,
  this.autocorrect = true,
  this.smartDashesType,
  this.smartQuotesType,
  this.enableSuggestions = true,
  this.minLines,
  this.expands = false,
  this.maxLength,
  this.maxLengthEnforcement,
  this.onEditingComplete,
  this.onSubmitted,
  this.inputFormatters,
  this.cursorWidth = 2.0,
  this.cursorHeight,
  this.cursorRadius = const Radius.circular(2.0),
  this.cursorColor,
  this.selectionHeightStyle = BoxHeightStyle.tight,
  this.selectionWidthStyle = BoxWidthStyle.tight,
  this.keyboardAppearance,
  this.scrollPadding = const EdgeInsets.all(20.0),
  this.enableInteractiveSelection,
  this.selectionControls,
  this.dragStartBehavior = DragStartBehavior.start,
  this.scrollController,
  this.scrollPhysics,
  this.onTap,
  this.autofillHints,
  this.enableIMEPersonalizedLearning = true,
  this.textDirection,
  this.clipBehavior = Clip.hardEdge,
  this.scribbleEnabled = true,
  this.onTapOutside,
  this.contextMenuBuilder = _defaultContextMenuBuilder,
  this.spellCheckConfiguration,
  this.magnifierConfiguration,
  this.selectAllOnFocus = false,
  this.updateValueWhenComposing = false,
  this.maxLines = 1,
}) : super.allFields(builder: (baseState) {
        final FormeCupertinoTextFieldState state =
            baseState as FormeCupertinoTextFieldState;

        return CupertinoTextField(
          controller: state.textEditingController,
          focusNode: state.focusNode,
          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,
          textDirection: textDirection,
          readOnly: state.readOnly,
          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,
          onEditingComplete: onEditingComplete,
          onSubmitted: onSubmitted,
          onTapOutside: onTapOutside,
          inputFormatters: inputFormatters,
          enabled: state.enabled,
          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: autofillHints,
          clipBehavior: clipBehavior,
          scribbleEnabled: scribbleEnabled,
          enableIMEPersonalizedLearning: enableIMEPersonalizedLearning,
          contextMenuBuilder: contextMenuBuilder,
          spellCheckConfiguration: spellCheckConfiguration,
          magnifierConfiguration: magnifierConfiguration,
        );
      });