How to show square on any digit in flutter UI like above example?
3
No native way to do this I think.But you can refer latex-related package like flutter_tex to implement this. A screenshot from its demo video:
flutter_tex
you can reach the superscript letters like this with FontFeatures:
FontFeatures
Text( 'The isotope 238U decays to 206Pb', style: TextStyle( fontFamily: 'Sorts Mill Goudy', fontFeatures: <FontFeature>[ FontFeature.superscripts(), ], ), ),
in this case, we used the superscripts() which will show the letters as a superscript.
superscripts()
read about it more in the official docs
Just use the Unicode character u00b2 which is superscript 2.
u00b2
'18.5 kg/mu00b2 - 25 kg/mu00b2'
Click here to cancel reply.
3
Answers
No native way to do this I think.But you can refer latex-related package like
flutter_tex
to implement this.A screenshot from its demo video:
you can reach the superscript letters like this with
FontFeatures
:in this case, we used the
superscripts()
which will show the letters as a superscript.read about it more in the official docs
Just use the Unicode character
u00b2
which is superscript 2.