Skip to content

Instantly share code, notes, and snippets.

@loonix
Created February 11, 2021 09:59
Show Gist options
  • Save loonix/5ca871a151ffabf25b16cdd1000dee71 to your computer and use it in GitHub Desktop.
Save loonix/5ca871a151ffabf25b16cdd1000dee71 to your computer and use it in GitHub Desktop.
Flutter vertical text widget
/// 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