Last active
August 10, 2020 17:37
-
-
Save stephaniefash/ff21333e3f2670cce63601d2a064db3c 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
class _MyHomePageState extends State<MyHomePage> { | |
String myText = "0123456789"; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
backgroundColor: Colors.black, | |
appBar: AppBar( | |
title: Text(widget.title), | |
), | |
body: Center( | |
child: Wrap( | |
alignment: WrapAlignment.center, | |
direction: Axis.vertical, //stack individual text widgets on top of each other | |
children: _arrayOfText(), | |
), | |
), | |
); | |
} | |
List<Text> _arrayOfText() { // split our text into individual text widgets | |
return myText | |
.split("") | |
.map((letter) => Text( | |
letter, | |
textAlign: TextAlign.center, | |
style: TextStyle( | |
fontWeight: FontWeight.w100, | |
fontSize: 40, | |
color: Colors.white), | |
)) | |
.toList(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment