Skip to content

Instantly share code, notes, and snippets.

@ipondroid
Created July 25, 2019 05:34
Show Gist options
  • Save ipondroid/f7dd024a80b4450e08cf033b0aeab9bf to your computer and use it in GitHub Desktop.
Save ipondroid/f7dd024a80b4450e08cf033b0aeab9bf 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(
textAlign: TextAlign.center,
text: TextSpan(
text: 'display size\n',
style: Theme.of(context).textTheme.display4,
children: <TextSpan>[
TextSpan(
text: longtext[0], style: Theme.of(context).textTheme.display3),
TextSpan(
text: longtext[1], style: Theme.of(context).textTheme.display2),
TextSpan(
text: longtext[2], style: Theme.of(context).textTheme.display3),
TextSpan(
text: longtext[3], style: Theme.of(context).textTheme.display1),
],
),
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment