Reputation: 370
I was actually preparing a login screen and decided to use a linear gradient as a background. I actually upgraded my Flutter SDK from 1.20 to 1.22 in the stable channel. Please click on the below links to check the problem
Show what should I do.
Thank you.
Upvotes: 0
Views: 2043
Reputation: 21
use flutter clean
and flutter pub cache repair
in command line ,
then restart the ide
Upvotes: 1
Reputation: 1235
you can try this one probably there could be some version mismatch.
Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [Colors.blue, Colors.red])),
child: Center(
child: Text(
'Hello Gradient!',
style: TextStyle(
fontSize: 48.0,
fontWeight: FontWeight.bold,
color: Colors.white),
),
),
)
Upvotes: 0