Skip to content

Instantly share code, notes, and snippets.

@ipondroid
Created July 25, 2019 05:33
Show Gist options
  • Save ipondroid/e00855d241d9cc2513d01af16c4af424 to your computer and use it in GitHub Desktop.
Save ipondroid/e00855d241d9cc2513d01af16c4af424 to your computer and use it in GitHub Desktop.
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('RichText Widget Demo'),
),
body: Center(
child: ListView(
padding: const EdgeInsets.all(20.0),
children: <Widget>[
RichText(
text: TextSpan(
style: Theme.of(context).textTheme.title,
children: <TextSpan>[
TextSpan(
text: 'textTheme\n'),
TextSpan(
text: longtext[0], style: Theme.of(context).textTheme.subtitle),
TextSpan(
text: longtext[1], style: Theme.of(context).textTheme.body1),
TextSpan(
text: longtext[2], style: Theme.of(context).textTheme.subtitle),
TextSpan(
text: longtext[3], style: Theme.of(context).textTheme.body1),
],
),
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment