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字符来实现这一点。