BidiTextField constructor
const
BidiTextField({
- Key? key,
- Object groupId = EditableText,
- TextEditingController? controller,
- FocusNode? focusNode,
- UndoHistoryController? undoController,
- InputDecoration? decoration = const InputDecoration(),
- TextInputType? keyboardType,
- TextInputAction? textInputAction,
- TextCapitalization textCapitalization = TextCapitalization.none,
- TextStyle? style,
- StrutStyle? strutStyle,
- TextAlign textAlign = TextAlign.start,
- TextAlignVertical? textAlignVertical,
- TextDirection? textDirection,
- bool readOnly = false,
- bool? showCursor,
- bool autofocus = false,
- MaterialStatesController? statesController,
- String obscuringCharacter = '•',
- bool obscureText = false,
- bool? autocorrect = true,
- SmartDashesType? smartDashesType,
- SmartQuotesType? smartQuotesType,
- bool enableSuggestions = true,
- int? maxLines = 1,
- int? minLines,
- bool expands = false,
- int? maxLength,
- MaxLengthEnforcement? maxLengthEnforcement,
- ValueChanged<
String> ? onChanged, - VoidCallback? onEditingComplete,
- ValueChanged<
String> ? onSubmitted, - AppPrivateCommandCallback? onAppPrivateCommand,
- List<
TextInputFormatter> ? inputFormatters, - bool? enabled,
- bool? ignorePointers,
- double cursorWidth = 2.0,
- double? cursorHeight,
- Radius? cursorRadius,
- bool? cursorOpacityAnimates,
- Color? cursorColor,
- Color? cursorErrorColor,
- BoxHeightStyle? selectionHeightStyle = ui.BoxHeightStyle.tight,
- BoxWidthStyle? selectionWidthStyle = ui.BoxWidthStyle.tight,
- Brightness? keyboardAppearance,
- EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- bool? enableInteractiveSelection,
- TextSelectionControls? selectionControls,
- GestureTapCallback? onTap,
- bool onTapAlwaysCalled = false,
- TapRegionCallback? onTapOutside,
- MouseCursor? mouseCursor,
- InputCounterWidgetBuilder? buildCounter,
- ScrollController? scrollController,
- ScrollPhysics? scrollPhysics,
- Iterable<
String> ? autofillHints = const <String>[], - ContentInsertionConfiguration? contentInsertionConfiguration,
- Clip clipBehavior = Clip.hardEdge,
- String? restorationId,
- bool enableIMEPersonalizedLearning = true,
- EditableTextContextMenuBuilder? contextMenuBuilder = _defaultContextMenuBuilder,
- bool canRequestFocus = true,
- SpellCheckConfiguration? spellCheckConfiguration,
- TextMagnifierConfiguration? magnifierConfiguration,
- int? sampleLength = 50,
- ValueChanged<
TextDirection> ? onDirectionChanged,
Implementation
const BidiTextField({
super.key,
super.groupId = EditableText,
super.controller,
super.focusNode,
super.undoController,
super.decoration = const InputDecoration(),
TextInputType? keyboardType,
super.textInputAction,
super.textCapitalization = TextCapitalization.none,
super.style,
super.strutStyle,
super.textAlign = TextAlign.start,
super.textAlignVertical,
super.textDirection,
super.readOnly = false,
super.showCursor,
super.autofocus = false,
super.statesController,
super.obscuringCharacter = '•',
super.obscureText = false,
super.autocorrect = true,
super.smartDashesType,
super.smartQuotesType,
super.enableSuggestions = true,
super.maxLines = 1,
super.minLines,
super.expands = false,
super.maxLength,
super.maxLengthEnforcement,
super.onChanged,
super.onEditingComplete,
super.onSubmitted,
super.onAppPrivateCommand,
super.inputFormatters,
super.enabled,
super.ignorePointers,
super.cursorWidth = 2.0,
super.cursorHeight,
super.cursorRadius,
super.cursorOpacityAnimates,
super.cursorColor,
super.cursorErrorColor,
super.selectionHeightStyle = ui.BoxHeightStyle.tight,
super.selectionWidthStyle = ui.BoxWidthStyle.tight,
super.keyboardAppearance,
super.scrollPadding = const EdgeInsets.all(20.0),
super.dragStartBehavior = DragStartBehavior.start,
super.enableInteractiveSelection,
super.selectionControls,
super.onTap,
super.onTapAlwaysCalled = false,
super.onTapOutside,
super.mouseCursor,
super.buildCounter,
super.scrollController,
super.scrollPhysics,
super.autofillHints = const <String>[],
super.contentInsertionConfiguration,
super.clipBehavior = Clip.hardEdge,
super.restorationId,
super.enableIMEPersonalizedLearning = true,
super.contextMenuBuilder = _defaultContextMenuBuilder,
super.canRequestFocus = true,
super.spellCheckConfiguration,
super.magnifierConfiguration,
this.sampleLength = 50,
this.onDirectionChanged,
}) : assert(obscuringCharacter.length == 1),
assert(maxLines == null || maxLines > 0),
assert(minLines == null || minLines > 0),
assert(
(maxLines == null) || (minLines == null) || (maxLines >= minLines),
"minLines can't be greater than maxLines",
),
assert(
!expands || (maxLines == null && minLines == null),
'minLines and maxLines must be null when expands is true.',
),
assert(!obscureText || maxLines == 1,
'Obscured fields cannot be multiline.'),
assert(maxLength == null ||
maxLength == TextField.noMaxLength ||
maxLength > 0),
// Assert the following instead of setting it directly to avoid surprising the user by silently changing the value they set.
assert(
!identical(textInputAction, TextInputAction.newline) ||
maxLines == 1 ||
!identical(keyboardType, TextInputType.text),
'Use keyboardType TextInputType.multiline when using TextInputAction.newline on a multiline TextField.',
);