Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Dart 如何格式化要在颤振中显示的文本_Dart_Flutter - Fatal编程技术网

Dart 如何格式化要在颤振中显示的文本

Dart 如何格式化要在颤振中显示的文本,dart,flutter,Dart,Flutter,我想在屏幕上显示以下文字,并正确显示上标。如何在颤振中做到这一点 您可以使用RichText和Unicode final defaultStyle = TextStyle(color: Colors.black); final blueStyle = TextStyle(color: Colors.blue); return Center( child: RichText( text: TextSpan(

我想在屏幕上显示以下文字,并正确显示上标。如何在颤振中做到这一点


您可以使用
RichText
Unicode

  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,",
                        ),
                      ])
                    ]),
              ),
            );
更多信息:

这说明您可以使用unicode字符来实现这一点。