how to change the ‘primarySwatch’ to white in the app bar – Flutter?
This is what I have:
,
I want to change the blueGrey (portion marked in red) to white. While trying to change this from
primarySwatch: Colors.blueGrey,
to
primarySwatch: Colors.white,
en error is showing as "The argument type ‘Color’ can’t be assigned to the parameter type ‘MaterialColor?’. "
I want to get it like this:
Tried to change the primarySwatch to ‘Colors.White’, created a class ‘basicColors’and added colors(colorHexcode) to variables in the class. Tried to call them in the position of ‘Colors.white’ as ‘basicColors.varibleName’. Didn’t work though.
2
Answers
Add below code in your main() function and import below library
inside main function