Created
February 11, 2021 09:59
-
-
Save loonix/5ca871a151ffabf25b16cdd1000dee71 to your computer and use it in GitHub Desktop.
Flutter vertical text widget
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
/// REF: https://stackoverflow.com/a/58345080/5232022 | |
class MyVerticalText extends StatelessWidget { | |
final String text; | |
const MyVerticalText(this.text); | |
@override | |
Widget build(BuildContext context) { | |
return Wrap( | |
runSpacing: 10, | |
direction: Axis.vertical, | |
alignment: WrapAlignment.center, | |
children: text.split("").map((string) => Text(string, style: TextStyle(fontSize: 12))).toList(), | |
); | |
} | |
} | |
/// Use this to call it | |
MyVerticalText("HELLO WORLD THANKS") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment