How to add shadows to text.
Under the TextStyle there is a shadows property also.
It will be helpful if you can include example for its implementation
Here is a simple example, borrowed from here:
Text(
'Hello, world!',
style: TextStyle(
shadows: <Shadow>[
Shadow(
offset: Offset(10.0, 10.0),
blurRadius: 3.0,
color: Color.fromARGB(255, 0, 0, 0),
),
Shadow(
offset: Offset(10.0, 10.0),
blurRadius: 8.0,
color: Color.fromARGB(125, 0, 0, 255),
),
],
),
),
I have added two simple Shadow
to show the effect of Offset
and blur effect
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(home: SO());
}
}
class SO extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.deepOrange.shade400,
appBar: AppBar(),
body: Center(
child: Text(
"A B C",
style: TextStyle(
fontSize: 80,
shadows: [Shadow(color: Colors.blue.shade100, offset: Offset(-10, -10)), Shadow(color: Colors.black, blurRadius: 8, offset: Offset(10, 10))]),
),
),
);
}
}
which gives
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With