Home > Blockchain >  How to show squared on digit in flutter
How to show squared on digit in flutter

Time:11-19

enter image description here

How to show squared on any digit in flutter UI like above example?

CodePudding user response:

Just use the Unicode character \u00b2 which is superscript 2.

'18.5 kg/m\u00b2 - 25 kg/m\u00b2'

CodePudding user response:

No native way to do this I think.But you can refer latex-related package like show square digit

CodePudding user response:

you can reach the superscript letters like this with FontFeatures:

Text(
  'The isotope 238U decays to 206Pb',
  style: TextStyle(
    fontFamily: 'Sorts Mill Goudy',
    fontFeatures: <FontFeature>[
      FontFeature.superscripts(),
    ],
  ),
),

enter image description here

in this case, we used the superscripts() which will show the letters as a superscript.

read about it more in the official docs

  • Related