0

I have a app that uses some scientific notation. The text input fields use labelText to indicate what kind of information belongs in each input field. Some of these require specific notation (e.g. CO2 where the 2 should be subscript).

I use a package to manage this with Text() widgets and its pretty trivial. However, labelText takes a string directly (not a Text widget). I can see from this link that dart has some limited built in support for common superscript notation, but not for subscript text. Anyone have an idea if / how this can be done with a simple text string?

Edit 1: This post indicates that you can extend InputDecoration, but I can't figure out how to either add a new text widget (not sure I can since its @immutable) or to modify textLabel to take a Widget rather than a string?

its_broke_again
  • 319
  • 4
  • 12

1 Answers1

0

Unfortunately, it does not work with flutter Web. As an example, with flutter Web a String with "\u00B9" ('1' superscript) does work, but a string with "\u207B" ('-' superscript) does not. Consequently you are unable to write a concentration using g.L-1 with '-1' as superscript.

Mery
  • 1
  • 1
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 16 '21 at 07:55