Created
July 25, 2019 05:33
-
-
Save ipondroid/e00855d241d9cc2513d01af16c4af424 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( | |
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