如何格式化要在Flutter中显示的文本

Pra*_*nna 1 dart flutter

我希望在屏幕上显示以下文本,并正确显示上标.如何在颤抖中做到这一点?

在此输入图像描述

die*_*per 5

你可以使用RichTextUnicode

  final defaultStyle = TextStyle(color: Colors.black);
  final blueStyle = TextStyle(color: Colors.blue);


        return Center(
              child: RichText(
                text: TextSpan(
                    text: "c. 10\u{207B}\u{2076} seconds: ",
                    style: defaultStyle,
                    children: [
                      TextSpan(text: "Hadron epoch ", style: blueStyle, children: [
                        TextSpan(
                          style: defaultStyle,
                          text:
                              "begins: As the universe cools to about 10\u{00B9}\u{2070} kelvin,",
                        ),
                      ])
                    ]),
              ),
            );
Run Code Online (Sandbox Code Playgroud)

更多信息:https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts