Created
July 25, 2019 05:34
-
-
Save ipondroid/f7dd024a80b4450e08cf033b0aeab9bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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