How can we create a super or sub-script text in flutter like we used to create in android using Spannable String class?

Viewed 3736

I want to create a superscript text like 2^4 then how can I do this in the flutter. If someone knows please let me know.

3 Answers

To answer your question in one liner

final String twoRaisedToFour = '2\u2074';

To know more about such unicodes refer to following answer unicode list

If this helps do accept the answer. Thank you :)

If you need a widget then you can go with Text.rich widget or if you need a text alone then you can create List<TextSpan> with the text you have and make into a single text

Related