skip to Main Content

enter image description here

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

3

Answers


  1. 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:
    show square digit

    Login or Signup to reply.
  2. 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

    Login or Signup to reply.
  3. Just use the Unicode character u00b2 which is superscript 2.

    '18.5 kg/mu00b2 - 25 kg/mu00b2'
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search