ShadTextarea constructor

const ShadTextarea({
  1. Key? key,
  2. String? initialValue,
  3. TextEditingController? controller,
  4. FocusNode? focusNode,
  5. Widget? placeholder,
  6. ShadDecoration? decoration,
  7. UndoHistoryController? undoController,
  8. ValueChanged<String>? onChanged,
  9. VoidCallback? onEditingComplete,
  10. ValueChanged<String>? onSubmitted,
  11. AppPrivateCommandCallback? onAppPrivateCommand,
  12. TextStyle? style,
  13. StrutStyle? strutStyle,
  14. TextAlign textAlign = TextAlign.start,
  15. TextDirection? textDirection,
  16. bool? showCursor,
  17. bool autofocus = false,
  18. bool enabled = true,
  19. double? cursorWidth,
  20. double? cursorHeight,
  21. Radius? cursorRadius,
  22. bool? cursorOpacityAnimates,
  23. Color? cursorColor,
  24. BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
  25. BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
  26. Brightness? keyboardAppearance,
  27. EdgeInsets scrollPadding = const EdgeInsets.all(20),
  28. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  29. bool? enableInteractiveSelection,
  30. TextSelectionControls? selectionControls,
  31. GestureTapCallback? onPressed,
  32. bool onPressedAlwaysCalled = false,
  33. TapRegionCallback? onPressedOutside,
  34. MouseCursor? mouseCursor,
  35. ScrollController? scrollController,
  36. ScrollPhysics? scrollPhysics,
  37. ContentInsertionConfiguration? contentInsertionConfiguration,
  38. Clip clipBehavior = Clip.hardEdge,
  39. String? restorationId,
  40. bool scribbleEnabled = true,
  41. bool enableIMEPersonalizedLearning = true,
  42. EditableTextContextMenuBuilder? contextMenuBuilder,
  43. SpellCheckConfiguration? spellCheckConfiguration,
  44. TextMagnifierConfiguration magnifierConfiguration = TextMagnifierConfiguration.disabled,
  45. Color? selectionColor,
  46. EdgeInsetsGeometry? padding,
  47. MainAxisAlignment? mainAxisAlignment,
  48. CrossAxisAlignment? crossAxisAlignment,
  49. AlignmentGeometry? alignment,
  50. TextStyle? placeholderStyle,
  51. AlignmentGeometry? placeholderAlignment,
  52. EdgeInsetsGeometry? inputPadding,
  53. double? gap,
  54. BoxConstraints? constraints,
  55. bool stylusHandwritingEnabled = EditableText.defaultStylusHandwritingEnabled,
  56. Object? groupId,
  57. bool readOnly = false,
  58. int? maxLength,
  59. double minHeight = 80,
  60. double maxHeight = 500,
  61. bool resizable = true,
  62. ValueChanged<double>? onHeightChanged,
  63. WidgetBuilder? resizeHandleBuilder,
  64. EdgeInsetsGeometry? scrollbarPadding,
  65. WidgetBuilder? keyboardToolbarBuilder,
  66. Widget? top,
  67. Widget? bottom,
  68. Widget? leading,
  69. Widget? trailing,
  70. ValueChanged<int>? onLineCountChange,
  71. double? verticalGap,
  72. bool? useBrowserContextMenu,
  73. ValueChanged<List<ShadClipboardItem>>? onPasteFiles,
  74. ValueChanged<Object>? onPasteFilesError,
})

Implementation

const ShadTextarea({
  super.key,
  this.initialValue,
  this.controller,
  this.focusNode,
  this.placeholder,
  this.decoration,
  this.undoController,
  this.onChanged,
  this.onEditingComplete,
  this.onSubmitted,
  this.onAppPrivateCommand,
  this.style,
  this.strutStyle,
  this.textAlign = TextAlign.start,
  this.textDirection,
  this.showCursor,
  this.autofocus = false,
  this.enabled = true,
  this.cursorWidth,
  this.cursorHeight,
  this.cursorRadius,
  this.cursorOpacityAnimates,
  this.cursorColor,
  this.selectionHeightStyle = ui.BoxHeightStyle.tight,
  this.selectionWidthStyle = ui.BoxWidthStyle.tight,
  this.keyboardAppearance,
  this.scrollPadding = const EdgeInsets.all(20),
  this.dragStartBehavior = DragStartBehavior.start,
  bool? enableInteractiveSelection,
  this.selectionControls,
  this.onPressed,
  this.onPressedAlwaysCalled = false,
  this.onPressedOutside,
  this.mouseCursor,
  this.scrollController,
  this.scrollPhysics,
  this.contentInsertionConfiguration,
  this.clipBehavior = Clip.hardEdge,
  this.restorationId,
  this.scribbleEnabled = true,
  this.enableIMEPersonalizedLearning = true,
  this.contextMenuBuilder,
  this.spellCheckConfiguration,
  this.magnifierConfiguration = TextMagnifierConfiguration.disabled,
  this.selectionColor,
  this.padding,
  this.mainAxisAlignment,
  this.crossAxisAlignment,
  this.alignment,
  this.placeholderStyle,
  this.placeholderAlignment,
  this.inputPadding,
  this.gap,
  this.constraints,
  this.stylusHandwritingEnabled =
      EditableText.defaultStylusHandwritingEnabled,
  this.groupId,
  this.readOnly = false,
  this.maxLength,
  this.minHeight = 80,
  this.maxHeight = 500,
  this.resizable = true,
  this.onHeightChanged,
  this.resizeHandleBuilder,
  this.scrollbarPadding,
  this.keyboardToolbarBuilder,
  this.top,
  this.bottom,
  this.leading,
  this.trailing,
  this.onLineCountChange,
  this.verticalGap,
  this.useBrowserContextMenu,
  this.onPasteFiles,
  this.onPasteFilesError,
}) : enableInteractiveSelection = enableInteractiveSelection ?? !readOnly,
     assert(
       initialValue == null || controller == null,
       'Either initialValue or controller must be specified',
     );