XTextField constructor
const
XTextField({
- Key? key,
- Object groupId = EditableText,
- String? restorationId,
- TextEditingController? controller,
- FocusNode? focusNode,
- InputDecoration? decoration,
- TextStyle? textStyle,
- StrutStyle? strutStyle,
- TextDirection? textDirection,
- TextAlignVertical? textAlignVertical,
- TextStyle? labelStyle,
- TextStyle? hintStyle,
- String? label,
- String? labelOnLine,
- String? hintText,
- bool isRequired = false,
- bool isEnable = true,
- Widget? prefixIcon,
- Widget? suffixIcon,
- TextInputType inputType = TextInputType.text,
- XTextFieldType fieldType = XTextFieldType.normal,
- TextCapitalization textCapitalization = TextCapitalization.sentences,
- int minLines = 1,
- int maxLines = 1,
- int maxLength = 500,
- bool isShowCounter = false,
- void onChanged()?,
- VoidCallback? onTap,
- bool onTapAlwaysCalled = false,
- TapRegionCallback? onTapOutside,
- TapRegionUpCallback? onTapUpOutside,
- VoidCallback? onEditingComplete,
- ValueChanged<
String> ? onFieldSubmitted, - TextInputAction textInputAction = TextInputAction.next,
- XTextFieldStyle? style,
- XTextFieldFileOptions? fileOptions,
- XTextFieldDropdownOptions? dropdownOptions,
- XTextFieldDatePickerOptions? datePickerOptions,
- XTextFieldTimePickerOptions? timePickerOptions,
- String? validator()?,
- void onFileSelected(
- File?
- void onDropdownChanged(
- dynamic
- void onDateSelected()?,
- void onTimeSelected()?,
- bool isReadOnly = false,
- bool isObscureText = false,
- TextAlign textAlign = TextAlign.start,
- EdgeInsets? contentPadding,
- AutovalidateMode? autovalidateMode,
- String? asyncErrorText,
- void onSaved()?,
- FloatingLabelBehavior floatingLabelBehavior = .auto,
- bool autofocus = false,
- bool? showCursor,
- String obscuringCharacter = '•',
- bool autocorrect = true,
- SmartDashesType? smartDashesType,
- SmartQuotesType? smartQuotesType,
- bool enableSuggestions = true,
- MaxLengthEnforcement? maxLengthEnforcement,
- bool expands = false,
- List<
TextInputFormatter> ? inputFormatters, - bool? enabled,
- bool? ignorePointers,
- double cursorWidth = 2.0,
- double? cursorHeight,
- Radius? cursorRadius,
- Color? cursorColor = Colors.black87,
- Color? cursorErrorColor,
- Brightness? keyboardAppearance,
- EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
- bool? enableInteractiveSelection,
- bool? selectAllOnFocus,
- TextSelectionControls? selectionControls,
- InputCounterWidgetBuilder? buildCounter,
- ScrollPhysics? scrollPhysics,
- Iterable<
String> ? autofillHints, - ScrollController? scrollController,
- bool enableIMEPersonalizedLearning = true,
- MouseCursor? mouseCursor,
- EditableTextContextMenuBuilder? contextMenuBuilder,
- SpellCheckConfiguration? spellCheckConfiguration,
- TextMagnifierConfiguration? magnifierConfiguration,
- UndoHistoryController? undoController,
- AppPrivateCommandCallback? onAppPrivateCommand,
- bool? cursorOpacityAnimates,
- BoxHeightStyle? selectionHeightStyle,
- BoxWidthStyle? selectionWidthStyle,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- ContentInsertionConfiguration? contentInsertionConfiguration,
- MaterialStatesController? statesController,
- Clip clipBehavior = Clip.hardEdge,
- bool stylusHandwritingEnabled = EditableText.defaultStylusHandwritingEnabled,
- bool canRequestFocus = true,
- List<
Locale> ? hintLocales,
Creates a new customizable XTextField.
Implementation
const XTextField({
super.key,
this.groupId = EditableText,
this.restorationId,
this.controller,
this.focusNode,
this.decoration,
this.textStyle,
this.strutStyle,
this.textDirection,
this.textAlignVertical,
this.labelStyle,
this.hintStyle,
this.label,
this.labelOnLine,
this.hintText,
this.isRequired = false,
this.isEnable = true,
this.prefixIcon,
this.suffixIcon,
this.inputType = TextInputType.text,
this.fieldType = XTextFieldType.normal,
this.textCapitalization = TextCapitalization.sentences,
this.minLines = 1,
this.maxLines = 1,
this.maxLength = 500,
this.isShowCounter = false,
this.onChanged,
this.onTap,
this.onTapAlwaysCalled = false,
this.onTapOutside,
this.onTapUpOutside,
this.onEditingComplete,
this.onFieldSubmitted,
this.textInputAction = TextInputAction.next,
this.style,
this.fileOptions,
this.dropdownOptions,
this.datePickerOptions,
this.timePickerOptions,
this.validator,
this.onFileSelected,
this.onDropdownChanged,
this.onDateSelected,
this.onTimeSelected,
this.isReadOnly = false,
this.isObscureText = false,
this.textAlign = TextAlign.start,
this.contentPadding,
this.autovalidateMode,
this.asyncErrorText,
this.onSaved,
this.floatingLabelBehavior = .auto,
this.autofocus = false,
this.showCursor,
this.obscuringCharacter = '•',
this.autocorrect = true,
this.smartDashesType,
this.smartQuotesType,
this.enableSuggestions = true,
this.maxLengthEnforcement,
this.expands = false,
this.inputFormatters,
this.enabled,
this.ignorePointers,
this.cursorWidth = 2.0,
this.cursorHeight,
this.cursorRadius,
this.cursorColor = Colors.black87,
this.cursorErrorColor,
this.keyboardAppearance,
this.scrollPadding = const EdgeInsets.all(20.0),
this.enableInteractiveSelection,
this.selectAllOnFocus,
this.selectionControls,
this.buildCounter,
this.scrollPhysics,
this.autofillHints,
this.scrollController,
this.enableIMEPersonalizedLearning = true,
this.mouseCursor,
this.contextMenuBuilder,
this.spellCheckConfiguration,
this.magnifierConfiguration,
this.undoController,
this.onAppPrivateCommand,
this.cursorOpacityAnimates,
this.selectionHeightStyle,
this.selectionWidthStyle,
this.dragStartBehavior = DragStartBehavior.start,
this.contentInsertionConfiguration,
this.statesController,
this.clipBehavior = Clip.hardEdge,
this.stylusHandwritingEnabled =
EditableText.defaultStylusHandwritingEnabled,
this.canRequestFocus = true,
this.hintLocales,
});