ShadTextarea constructor
const
ShadTextarea({
- Key? key,
- String? initialValue,
- TextEditingController? controller,
- FocusNode? focusNode,
- Widget? placeholder,
- ShadDecoration? decoration,
- UndoHistoryController? undoController,
- ValueChanged<
String> ? onChanged, - VoidCallback? onEditingComplete,
- ValueChanged<
String> ? onSubmitted, - AppPrivateCommandCallback? onAppPrivateCommand,
- TextStyle? style,
- StrutStyle? strutStyle,
- TextAlign textAlign = TextAlign.start,
- TextDirection? textDirection,
- bool? showCursor,
- bool autofocus = false,
- bool enabled = true,
- double? cursorWidth,
- double? cursorHeight,
- Radius? cursorRadius,
- bool? cursorOpacityAnimates,
- Color? cursorColor,
- BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
- BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
- Brightness? keyboardAppearance,
- EdgeInsets scrollPadding = const EdgeInsets.all(20),
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- bool? enableInteractiveSelection,
- TextSelectionControls? selectionControls,
- GestureTapCallback? onPressed,
- bool onPressedAlwaysCalled = false,
- TapRegionCallback? onPressedOutside,
- MouseCursor? mouseCursor,
- ScrollController? scrollController,
- ScrollPhysics? scrollPhysics,
- ContentInsertionConfiguration? contentInsertionConfiguration,
- Clip clipBehavior = Clip.hardEdge,
- String? restorationId,
- bool scribbleEnabled = true,
- bool enableIMEPersonalizedLearning = true,
- EditableTextContextMenuBuilder? contextMenuBuilder,
- SpellCheckConfiguration? spellCheckConfiguration,
- TextMagnifierConfiguration magnifierConfiguration = TextMagnifierConfiguration.disabled,
- Color? selectionColor,
- EdgeInsetsGeometry? padding,
- MainAxisAlignment? mainAxisAlignment,
- CrossAxisAlignment? crossAxisAlignment,
- AlignmentGeometry? alignment,
- TextStyle? placeholderStyle,
- AlignmentGeometry? placeholderAlignment,
- EdgeInsetsGeometry? inputPadding,
- double? gap,
- BoxConstraints? constraints,
- bool stylusHandwritingEnabled = EditableText.defaultStylusHandwritingEnabled,
- Object? groupId,
- bool readOnly = false,
- int? maxLength,
- double minHeight = 80,
- double maxHeight = 500,
- bool resizable = true,
- ValueChanged<
double> ? onHeightChanged, - WidgetBuilder? resizeHandleBuilder,
- EdgeInsetsGeometry? scrollbarPadding,
- WidgetBuilder? keyboardToolbarBuilder,
- Widget? top,
- Widget? bottom,
- Widget? leading,
- Widget? trailing,
- ValueChanged<
int> ? onLineCountChange, - double? verticalGap,
- bool? useBrowserContextMenu,
- ValueChanged<
List< ? onPasteFiles,ShadClipboardItem> > - 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',
);