RichText class for flutter

PHOTO EMBED

Tue Sep 14 2021 15:43:06 GMT+0000 (UTC)

Saved by @brainyworld #dart #flutter

RichText(
  text: TextSpan(
    text: 'Hello ',
    style: DefaultTextStyle.of(context).style,
    children: const <TextSpan>[
      TextSpan(text: 'bold', style: TextStyle(fontWeight: FontWeight.bold)),
      TextSpan(text: ' world!'),
    ],
  ),
)
content_copyCOPY

This help to have different style of text in a single line.

https://api.flutter.dev/flutter/widgets/RichText-class.html