TxPickerFormField<T, V>.custom constructor
TxPickerFormField<T, V>.custom ({
- required PickVoidCallback<
T> ? onPickTap, - required ContextValueMapper<
T, String> displayTextMapper, - bool? clearable,
- Key? key,
- FormFieldSetter<
T> ? onSaved, - FormFieldValidator<
T> ? validator, - bool? enabled,
- AutovalidateMode? autovalidateMode = AutovalidateMode.onUserInteraction,
- String? restorationId,
- InputDecoration? decoration,
- ValueChanged<
T?> ? onChanged, - bool? required,
- T? initialValue,
- String? hintText,
- TextEditingController? controller,
- FocusNode? focusNode,
- TextInputType? keyboardType,
- TextCapitalization? textCapitalization,
- TextInputAction? textInputAction,
- TextStyle? style,
- StrutStyle? strutStyle,
- TextDirection? textDirection,
- TextAlign? textAlign,
- bool? bordered,
- TextAlignVertical? textAlignVertical,
- bool? autofocus,
- bool? readOnly,
- bool? inputEnabled,
- bool? showCursor,
- String? obscuringCharacter,
- bool? obscureText,
- bool? autocorrect,
- SmartDashesType? smartDashesType,
- SmartQuotesType? smartQuotesType,
- bool? enableSuggestions,
- MaxLengthEnforcement? maxLengthEnforcement,
- int? maxLines,
- int? minLines,
- bool? expands,
- int? maxLength,
- GestureTapCallback? onTap,
- bool? onTapAlwaysCalled,
- TapRegionCallback? onTapOutside,
- VoidCallback? onEditingComplete,
- ValueChanged<
String> ? onFieldSubmitted, - List<
TextInputFormatter> ? inputFormatters, - double? cursorWidth,
- double? cursorHeight,
- Color? cursorColor,
- Radius? cursorRadius,
- Color? cursorErrorColor,
- Brightness? keyboardAppearance,
- EdgeInsets? scrollPadding,
- bool? enableInteractiveSelection,
- TextSelectionControls? selectionControls,
- InputCounterWidgetBuilder? buildCounter,
- ScrollPhysics? scrollPhysics,
- Iterable<
String> ? autofillHints, - ScrollController? scrollController,
- bool? enableIMEPersonalizedLearning,
- MouseCursor? mouseCursor,
- EditableTextContextMenuBuilder? contextMenuBuilder,
- SpellCheckConfiguration? spellCheckConfiguration,
- TextMagnifierConfiguration? magnifierConfiguration,
- UndoHistoryController? undoController,
- AppPrivateCommandCallback? onAppPrivateCommand,
- bool? cursorOpacityAnimates,
- BoxHeightStyle? selectionHeightStyle,
- BoxWidthStyle? selectionWidthStyle,
- DragStartBehavior? dragStartBehavior,
- ContentInsertionConfiguration? contentInsertionConfiguration,
- MaterialStatesController? statesController,
- Clip? clipBehavior,
- bool? scribbleEnabled,
- bool? canRequestFocus,
- Widget? label,
- String? labelText,
- TextAlign? labelTextAlign,
- TextOverflow? labelOverflow,
- EdgeInsetsGeometry? padding,
- FieldActionsBuilder<
T> ? actionsBuilder, - TextStyle? labelStyle,
- double? horizontalGap,
- Color? tileColor,
- Axis? layoutDirection,
- TxFormFieldBuilder<
T> ? trailingBuilder, - Widget? leading,
- VisualDensity? visualDensity,
- ShapeBorder? shape,
- Color? iconColor,
- Color? textColor,
- TextStyle? leadingAndTrailingTextStyle,
- double? minLeadingWidth,
- double? minLabelWidth,
- double? minVerticalPadding,
- bool? dense,
- Color? focusColor,
- 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),
);