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. MaterialStatesController? 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 canRequestFocus = true,
  64. SpellCheckConfiguration? spellCheckConfiguration,
  65. TextMagnifierConfiguration? magnifierConfiguration,
  66. int? sampleLength = 50,
  67. 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.',
      );