i want to show a superscript text but not found any example or can anyone help me with this.
I have tried Text and RichText also, but not found any method or fields.
You can make use of offset property in WidgetSpan. I have used the below code to show flight cross overs. The Offset dx and dy values helps you to set superscript or subscript as per your need.
RichText(
text: TextSpan(children: [
TextSpan(
text: '9:30 - 2:30',
style: TextStyle(color: Colors.black)),
WidgetSpan(
child: Transform.translate(
offset: const Offset(2, -4),
child: Text(
'+2',
//superscript is usually smaller in size
textScaleFactor: 0.7,
style: TextStyle(color: Colors.red),
),
),
)
]),
)