TxPickerFormField<T, V>.custom constructor

TxPickerFormField<T, V>.custom({
  1. required PickVoidCallback<T>? onPickTap,
  2. required ContextValueMapper<T, String> displayTextMapper,
  3. bool? clearable,
  4. Key? key,
  5. FormFieldSetter<T>? onSaved,
  6. FormFieldValidator<T>? validator,
  7. bool? enabled,
  8. AutovalidateMode? autovalidateMode = AutovalidateMode.onUserInteraction,
  9. String? restorationId,
  10. InputDecoration? decoration,
  11. ValueChanged<T?>? onChanged,
  12. bool? required,
  13. T? initialValue,
  14. String? hintText,
  15. TextEditingController? controller,
  16. FocusNode? focusNode,
  17. TextInputType? keyboardType,
  18. TextCapitalization? textCapitalization,
  19. TextInputAction? textInputAction,
  20. TextStyle? style,
  21. StrutStyle? strutStyle,
  22. TextDirection? textDirection,
  23. TextAlign? textAlign,
  24. bool? bordered,
  25. TextAlignVertical? textAlignVertical,
  26. bool? autofocus,
  27. bool? readOnly,
  28. bool? inputEnabled,
  29. bool? showCursor,
  30. String? obscuringCharacter,
  31. bool? obscureText,
  32. bool? autocorrect,
  33. SmartDashesType? smartDashesType,
  34. SmartQuotesType? smartQuotesType,
  35. bool? enableSuggestions,
  36. MaxLengthEnforcement? maxLengthEnforcement,
  37. int? maxLines,
  38. int? minLines,
  39. bool? expands,
  40. int? maxLength,
  41. GestureTapCallback? onTap,
  42. bool? onTapAlwaysCalled,
  43. TapRegionCallback? onTapOutside,
  44. VoidCallback? onEditingComplete,
  45. ValueChanged<String>? onFieldSubmitted,
  46. List<TextInputFormatter>? inputFormatters,
  47. double? cursorWidth,
  48. double? cursorHeight,
  49. Color? cursorColor,
  50. Radius? cursorRadius,
  51. Color? cursorErrorColor,
  52. Brightness? keyboardAppearance,
  53. EdgeInsets? scrollPadding,
  54. bool? enableInteractiveSelection,
  55. TextSelectionControls? selectionControls,
  56. InputCounterWidgetBuilder? buildCounter,
  57. ScrollPhysics? scrollPhysics,
  58. Iterable<String>? autofillHints,
  59. ScrollController? scrollController,
  60. bool? enableIMEPersonalizedLearning,
  61. MouseCursor? mouseCursor,
  62. EditableTextContextMenuBuilder? contextMenuBuilder,
  63. SpellCheckConfiguration? spellCheckConfiguration,
  64. TextMagnifierConfiguration? magnifierConfiguration,
  65. UndoHistoryController? undoController,
  66. AppPrivateCommandCallback? onAppPrivateCommand,
  67. bool? cursorOpacityAnimates,
  68. BoxHeightStyle? selectionHeightStyle,
  69. BoxWidthStyle? selectionWidthStyle,
  70. DragStartBehavior? dragStartBehavior,
  71. ContentInsertionConfiguration? contentInsertionConfiguration,
  72. MaterialStatesController? statesController,
  73. Clip? clipBehavior,
  74. bool? scribbleEnabled,
  75. bool? canRequestFocus,
  76. Widget? label,
  77. String? labelText,
  78. TextAlign? labelTextAlign,
  79. TextOverflow? labelOverflow,
  80. EdgeInsetsGeometry? padding,
  81. FieldActionsBuilder<T>? actionsBuilder,
  82. TextStyle? labelStyle,
  83. double? horizontalGap,
  84. Color? tileColor,
  85. Axis? layoutDirection,
  86. TxFormFieldBuilder<T>? trailingBuilder,
  87. Widget? leading,
  88. VisualDensity? visualDensity,
  89. ShapeBorder? shape,
  90. Color? iconColor,
  91. Color? textColor,
  92. TextStyle? leadingAndTrailingTextStyle,
  93. double? minLeadingWidth,
  94. double? minLabelWidth,
  95. double? minVerticalPadding,
  96. bool? dense,
  97. Color? focusColor,
  98. bool? colon,
})

Implementation

TxPickerFormField.custom({
  required PickVoidCallback<T>? onPickTap,
  required super.displayTextMapper,
  super.clearable,
  super.key,
  super.onSaved,
  FormFieldValidator<T>? validator,
  super.enabled,
  super.autovalidateMode,
  super.restorationId,
  super.decoration,
  super.onChanged,
  super.required,
  super.initialValue,
  String? hintText,
  super.controller,
  super.focusNode,
  super.keyboardType,
  super.textCapitalization,
  super.textInputAction,
  super.style,
  super.strutStyle,
  super.textDirection,
  super.textAlign,
  super.bordered,
  super.textAlignVertical,
  super.autofocus,
  bool? readOnly,
  bool? inputEnabled,
  super.showCursor,
  super.obscuringCharacter,
  super.obscureText,
  super.autocorrect,
  super.smartDashesType,
  super.smartQuotesType,
  super.enableSuggestions,
  super.maxLengthEnforcement,
  super.maxLines,
  super.minLines,
  super.expands,
  super.maxLength,
  super.onTap,
  super.onTapAlwaysCalled,
  super.onTapOutside,
  super.onEditingComplete,
  super.onFieldSubmitted,
  super.inputFormatters,
  super.cursorWidth,
  super.cursorHeight,
  super.cursorColor,
  super.cursorRadius,
  super.cursorErrorColor,
  super.keyboardAppearance,
  super.scrollPadding,
  super.enableInteractiveSelection,
  super.selectionControls,
  super.buildCounter,
  super.scrollPhysics,
  super.autofillHints,
  super.scrollController,
  super.enableIMEPersonalizedLearning,
  super.mouseCursor,
  super.contextMenuBuilder,
  super.spellCheckConfiguration,
  super.magnifierConfiguration,
  super.undoController,
  super.onAppPrivateCommand,
  super.cursorOpacityAnimates,
  super.selectionHeightStyle,
  super.selectionWidthStyle,
  super.dragStartBehavior,
  super.contentInsertionConfiguration,
  super.statesController,
  super.clipBehavior,
  super.scribbleEnabled,
  super.canRequestFocus,
  super.label,
  super.labelText,
  super.labelTextAlign,
  super.labelOverflow,
  super.padding,
  super.actionsBuilder,
  super.labelStyle,
  super.horizontalGap,
  super.tileColor,
  super.layoutDirection,
  super.trailingBuilder,
  super.leading,
  super.visualDensity,
  super.shape,
  super.iconColor,
  super.textColor,
  super.leadingAndTrailingTextStyle,
  super.minLeadingWidth,
  super.minLabelWidth,
  super.minVerticalPadding,
  super.dense,
  super.focusColor,
  super.colon,
})  : _readOnly = readOnly ?? false,
      inputEnabled = inputEnabled ?? false,
      super(
        onFieldTap:
            readOnly == true ? null : (field) => _onTap(field, onPickTap!),
        readOnly: inputEnabled != true || readOnly == true,
        onInputChanged: (field, text) =>
            _onInputChanged<T>(field, text, inputEnabled),
        hintText: readOnly == true
            ? null
            : hintText ?? (inputEnabled == true ? '请选择或输入' : '请选择'),
        validator: (val) => generateValidator(val, validator, required),
      );