I used Text.rich()
or RichText
with font size 25. but the size of RichText
is looking greater than the Text.rich()
please tell me why the size is different, I specified font Size 25
for both widgets.
This code showing small font size:
runApp(MaterialApp(
theme: ThemeData(fontFamily: "nunito"),
home: Scaffold(
appBar: AppBar(title: Text("PUROGRAMMER")),
body: Center(child: Container(
child: Text.rich(
TextSpan(
style: TextStyle(fontSize: 20, color: Colors.grey),
children: [
TextSpan(text: "Click"),
TextSpan(text: " + ", style: TextStyle(color: Colors.red, fontWeight: FontWeight.bold)),
TextSpan(text: "to add")
]
)
)),)
),
));
And this is showing large font size:
runApp(MaterialApp(
theme: ThemeData(fontFamily: "nunito"),
home: Scaffold(
appBar: AppBar(title: Text("PUROGRAMMER")),
body: Center(child: Container(
child: TRichText(
text: TextSpan(
style: TextStyle(fontSize: 20, color: Colors.grey),
children: [
TextSpan(text: "Click"),
TextSpan(text: " + ", style: TextStyle(color: Colors.red, fontWeight: FontWeight.bold)),
TextSpan(text: "to add")
]
)
)),)
),
));