Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to globally override default Colors.blue color for the ThemeData?

Tags:

flutter

In flutter even when I set

primaryColor: Colors.orange,

then in some part of the UI the default Colors.blue is still present. Is there a way how to globally override it for the ThemeData?

like image 240
andy007 Avatar asked Dec 07 '25 04:12

andy007


1 Answers

In order for me to override Colors.blue, I had to state primarySwatch in the ThemeData and also the colorScheme, as in

theme: ThemeData(
  primarySwatch: Colors.orange,
  colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.orange),
),
like image 51
Don Capuano Avatar answered Dec 11 '25 23:12

Don Capuano



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!