StyledText.selectable constructor
const
StyledText.selectable({
- Key? key,
- required String text,
- bool newLineAsBreaks = false,
- TextStyle? style,
- Map<
String, StyledTextTagBase> ? tags, - TextAlign? textAlign,
- TextDirection? textDirection,
- double? textScaleFactor,
- int? maxLines,
- StrutStyle? strutStyle,
- TextWidthBasis? textWidthBasis,
- TextHeightBehavior? textHeightBehavior,
- FocusNode? focusNode,
- bool showCursor = false,
- bool autofocus = false,
- @Deprecated('Use `contextMenuBuilder` instead. ' 'This feature was deprecated after Flutter v3.3.0-0.5.pre.') ToolbarOptions? toolbarOptions,
- EditableTextContextMenuBuilder contextMenuBuilder = _defaultContextMenuBuilder,
- TextSelectionControls? selectionControls,
- BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
- BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
- SelectionChangedCallback? onSelectionChanged,
- TextMagnifierConfiguration? magnifierConfiguration,
- double cursorWidth = 2.0,
- double? cursorHeight,
- Radius? cursorRadius,
- Color? cursorColor,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- bool enableInteractiveSelection = true,
- GestureTapCallback? onTap,
- ScrollPhysics? scrollPhysics,
- String? semanticsLabel,
Create a selectable text widget with formatting via tags.
See SelectableText.rich for more options.
Implementation
const StyledText.selectable({
Key? key,
required this.text,
this.newLineAsBreaks = false,
this.style,
Map<String, StyledTextTagBase>? tags,
this.textAlign,
this.textDirection,
this.textScaleFactor,
this.maxLines,
this.strutStyle,
this.textWidthBasis,
this.textHeightBehavior,
FocusNode? focusNode,
bool showCursor = false,
bool autofocus = false,
@Deprecated(
'Use `contextMenuBuilder` instead. '
'This feature was deprecated after Flutter v3.3.0-0.5.pre.',
)
// ignore: deprecated_member_use
ToolbarOptions? toolbarOptions,
EditableTextContextMenuBuilder contextMenuBuilder =
_defaultContextMenuBuilder,
TextSelectionControls? selectionControls,
ui.BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
ui.BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
SelectionChangedCallback? onSelectionChanged,
TextMagnifierConfiguration? magnifierConfiguration,
double cursorWidth = 2.0,
double? cursorHeight,
Radius? cursorRadius,
Color? cursorColor,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
bool enableInteractiveSelection = true,
GestureTapCallback? onTap,
ScrollPhysics? scrollPhysics,
String? semanticsLabel,
}) : this.tags = tags ?? const {},
this.selectable = true,
this.softWrap = true,
this.overflow = TextOverflow.clip,
this.locale = null,
this._focusNode = focusNode,
this._showCursor = showCursor,
this._autofocus = autofocus,
this._toolbarOptions = toolbarOptions ??
// ignore: deprecated_member_use
const ToolbarOptions(
selectAll: true,
copy: true,
),
this._contextMenuBuilder = contextMenuBuilder,
this._selectionHeightStyle = selectionHeightStyle,
this._selectionWidthStyle = selectionWidthStyle,
this._selectionControls = selectionControls,
this._onSelectionChanged = onSelectionChanged,
this._magnifierConfiguration = magnifierConfiguration,
this._cursorWidth = cursorWidth,
this._cursorHeight = cursorHeight,
this._cursorRadius = cursorRadius,
this._cursorColor = cursorColor,
this._dragStartBehavior = dragStartBehavior,
this._enableInteractiveSelection = enableInteractiveSelection,
this._onTap = onTap,
this._scrollPhysics = scrollPhysics,
this._semanticsLabel = semanticsLabel,
super(key: key);