Text.rich constructor

const Text.rich(
  1. List<Span> spans, {
  2. Key? key,
  3. Style style = const Style(),
  4. TextWrap wrap = TextWrap.word,
  5. TextOverflow overflow = TextOverflow.clip,
  6. int? maxLines,
  7. TextAlign textAlign = TextAlign.left,
  8. void onLinkTap(
    1. String url
    )?,
})

Shows spans, each in its style merged onto style, as one paragraph: a line breaks between spans as it does inside one.

Text.rich(['Error: '.bold.fg(Color.red), const Span('not found')])

Implementation

const Text.rich(
  List<Span> this.spans, {
  super.key,
  this.style = const Style(),
  this.wrap = TextWrap.word,
  this.overflow = TextOverflow.clip,
  this.maxLines,
  this.textAlign = TextAlign.left,
  this.onLinkTap,
}) : data = null;