BidiTextField constructor

const BidiTextField({
  1. Key? key,
  2. Object groupId = EditableText,
  3. TextEditingController? controller,
  4. FocusNode? focusNode,
  5. UndoHistoryController? undoController,
  6. InputDecoration? decoration = const InputDecoration(),
  7. TextInputType? keyboardType,
  8. TextInputAction? textInputAction,
  9. TextCapitalization textCapitalization = TextCapitalization.none,
  10. TextStyle? style,
  11. StrutStyle? strutStyle,
  12. TextAlign textAlign = TextAlign.start,
  13. TextAlignVertical? textAlignVertical,
  14. TextDirection? textDirection,
  15. bool readOnly = false,
  16. bool? showCursor,
  17. bool autofocus = false,
  18. WidgetStatesController? statesController,
  19. String obscuringCharacter = '•',
  20. bool obscureText = false,
  21. bool autocorrect = true,
  22. SmartDashesType? smartDashesType,
  23. SmartQuotesType? smartQuotesType,
  24. bool enableSuggestions = true,
  25. int? maxLines = 1,
  26. int? minLines,
  27. bool expands = false,
  28. int? maxLength,
  29. MaxLengthEnforcement? maxLengthEnforcement,
  30. ValueChanged<String>? onChanged,
  31. VoidCallback? onEditingComplete,
  32. ValueChanged<String>? onSubmitted,
  33. AppPrivateCommandCallback? onAppPrivateCommand,
  34. List<TextInputFormatter>? inputFormatters,
  35. bool? enabled,
  36. bool? ignorePointers,
  37. double cursorWidth = 2.0,
  38. double? cursorHeight,
  39. Radius? cursorRadius,
  40. bool? cursorOpacityAnimates,
  41. Color? cursorColor,
  42. Color? cursorErrorColor,
  43. BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
  44. BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
  45. Brightness? keyboardAppearance,
  46. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  47. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  48. bool? enableInteractiveSelection,
  49. TextSelectionControls? selectionControls,
  50. GestureTapCallback? onTap,
  51. bool onTapAlwaysCalled = false,
  52. TapRegionCallback? onTapOutside,
  53. MouseCursor? mouseCursor,
  54. InputCounterWidgetBuilder? buildCounter,
  55. ScrollController? scrollController,
  56. ScrollPhysics? scrollPhysics,
  57. Iterable<String>? autofillHints = const <String>[],
  58. ContentInsertionConfiguration? contentInsertionConfiguration,
  59. Clip clipBehavior = Clip.hardEdge,
  60. String? restorationId,
  61. bool enableIMEPersonalizedLearning = true,
  62. EditableTextContextMenuBuilder? contextMenuBuilder = _defaultContextMenuBuilder,
  63. bool stylusHandwritingEnabled = true,
  64. SpellCheckConfiguration? spellCheckConfiguration,
  65. TextMagnifierConfiguration? magnifierConfiguration,
  66. int? sampleLength = 50,
  67. ValueChanged<TextDirection>? onDirectionChanged,
})

Implementation

const BidiTextField({
  super.key,
  this.groupId = EditableText,
  this.controller,
  this.focusNode,
  this.undoController,
  this.decoration = const InputDecoration(),
  this.keyboardType,
  this.textInputAction,
  this.textCapitalization = TextCapitalization.none,
  this.style,
  this.strutStyle,
  this.textAlign = TextAlign.start,
  this.textAlignVertical,
  this.textDirection,
  this.readOnly = false,
  this.showCursor,
  this.autofocus = false,
  this.statesController,
  this.obscuringCharacter = '•',
  this.obscureText = false,
  this.autocorrect = true,
  this.smartDashesType,
  this.smartQuotesType,
  this.enableSuggestions = true,
  this.maxLines = 1,
  this.minLines,
  this.expands = false,
  this.maxLength,
  this.maxLengthEnforcement,
  this.onChanged,
  this.onEditingComplete,
  this.onSubmitted,
  this.onAppPrivateCommand,
  this.inputFormatters,
  this.enabled,
  this.ignorePointers,
  this.cursorWidth = 2.0,
  this.cursorHeight,
  this.cursorRadius,
  this.cursorOpacityAnimates,
  this.cursorColor,
  this.cursorErrorColor,
  this.selectionHeightStyle = ui.BoxHeightStyle.tight,
  this.selectionWidthStyle = ui.BoxWidthStyle.tight,
  this.keyboardAppearance,
  this.scrollPadding = const EdgeInsets.all(20.0),
  this.dragStartBehavior = DragStartBehavior.start,
  this.enableInteractiveSelection,
  this.selectionControls,
  this.onTap,
  this.onTapAlwaysCalled = false,
  this.onTapOutside,
  this.mouseCursor,
  this.buildCounter,
  this.scrollController,
  this.scrollPhysics,
  this.autofillHints = const <String>[],
  this.contentInsertionConfiguration,
  this.clipBehavior = Clip.hardEdge,
  this.restorationId,
  this.enableIMEPersonalizedLearning = true,
  this.contextMenuBuilder = _defaultContextMenuBuilder,
  this.stylusHandwritingEnabled = true,
  this.spellCheckConfiguration,
  this.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(
        !identical(textInputAction, TextInputAction.newline) ||
            maxLines == 1 ||
            !identical(keyboardType, TextInputType.text),
        'Use keyboardType TextInputType.multiline when using TextInputAction.newline on a multiline TextField.',
      );