BidiText.rich constructor
const
BidiText.rich(
- InlineSpan textSpan, {
- Key? key,
- TextStyle? style,
- StrutStyle? strutStyle,
- TextAlign? textAlign,
- Locale? locale,
- bool? softWrap,
- TextOverflow? overflow,
- TextScaler? textScaler,
- int? maxLines,
- String? semanticsLabel,
- TextWidthBasis? textWidthBasis,
- TextHeightBehavior? textHeightBehavior,
- Color? selectionColor,
- int? sampleLength = 50,
Creates a BidiText widget with an InlineSpan — a drop-in replacement for Text.rich.
Direction is detected by extracting all text from the InlineSpan tree (including nested TextSpan children; WidgetSpan nodes are ignored).
Example:
BidiText.rich(
TextSpan(children: [
TextSpan(text: 'مرحبا '),
TextSpan(text: 'world', style: TextStyle(fontWeight: FontWeight.bold)),
]),
)
Implementation
const BidiText.rich(
InlineSpan this.textSpan, {
super.key,
this.style,
this.strutStyle,
this.textAlign,
this.locale,
this.softWrap,
this.overflow,
this.textScaler,
this.maxLines,
this.semanticsLabel,
this.textWidthBasis,
this.textHeightBehavior,
this.selectionColor,
this.sampleLength = 50,
}) : data = null;