selectableRich static method
Widget
selectableRich(
- TextSpan textSpan, {
- Key? key,
- FocusNode? focusNode,
- bool autofocus = false,
- TextSelectionControls? selectionControls,
- TextDirection? textDirection,
- Color? backgroundColor,
- TextAlign textAlign = TextAlign.start,
- TextWidthBasis? textWidthBasis,
- TextScaler textScaler = TextScaler.noScaling,
- double innerRadius = kDefaultInnerRadius,
- double outerRadius = kDefaultOuterRadius,
- double cursorWidth = 2.0,
- Color? cursorColor,
- double? cursorHeight,
- Radius? cursorRadius,
- SelectionChangedCallback? onSelectionChanged,
- bool enableInteractiveSelection = true,
- String? semanticsLabel,
- TextMagnifierConfiguration? magnifierConfiguration,
Creates a selectable RoundedBackgroundText that can have multiple styles
See also:
- SelectableText, a run of selectable text with a single style.
- RoundedBackgroundTextField, the editable version of this widget.
Implementation
static Widget selectableRich(
TextSpan textSpan, {
Key? key,
FocusNode? focusNode,
bool autofocus = false,
TextSelectionControls? selectionControls,
TextDirection? textDirection,
Color? backgroundColor,
TextAlign textAlign = TextAlign.start,
TextWidthBasis? textWidthBasis,
TextScaler textScaler = TextScaler.noScaling,
double innerRadius = kDefaultInnerRadius,
double outerRadius = kDefaultOuterRadius,
double cursorWidth = 2.0,
Color? cursorColor,
double? cursorHeight,
Radius? cursorRadius,
SelectionChangedCallback? onSelectionChanged,
bool enableInteractiveSelection = true,
String? semanticsLabel,
TextMagnifierConfiguration? magnifierConfiguration,
}) {
return Stack(children: [
RoundedBackgroundText.rich(
text: textSpan,
textDirection: textDirection,
textAlign: textAlign,
textScaler: textScaler,
innerRadius: innerRadius,
outerRadius: outerRadius,
backgroundColor: backgroundColor,
textWidthBasis: textWidthBasis,
),
SelectableText.rich(
textSpan,
textDirection: textDirection,
textAlign: textAlign,
textScaler: textScaler,
cursorColor: cursorColor,
cursorHeight: cursorHeight,
cursorRadius: cursorRadius,
cursorWidth: cursorWidth,
selectionControls: selectionControls,
onSelectionChanged: onSelectionChanged,
enableInteractiveSelection: enableInteractiveSelection,
focusNode: focusNode,
autofocus: autofocus,
semanticsLabel: semanticsLabel,
magnifierConfiguration: magnifierConfiguration,
textWidthBasis: textWidthBasis,
),
]);
}