How to display exponent string in Flutter?
408
You can make use of offset property in WidgetSpan.
RichText(
text: TextSpan(children: [
TextSpan(text: '90 m',),
WidgetSpan(
child: Transform.translate(
offset: const Offset(2, -4),
child: Text(
'2',
//superscript is usually smaller in size
textScaleFactor: 0.7,
),
),
)
]),
)
or use the Unicode of exponent 2
Text("90 m\u00B2"),
Author by