When I try to set Colors.black primarySwatch color, I got error:
type 'Color' is not a subtype of type 'MaterialColor' in flutter.
How to solve Color is not a subtype of MaterialColor?
- 4 years ago
thats way you are getting error type 'Color' is not a subtype of type 'MaterialColor'
primarySwatch is a banch of multiple colors for deffrant part like primarySwatch has color for status bar Titlebar etc.
you are tring to set single colors for primarySwatch.
if you want to setup deffrente colors for your own dont use primarySwatch
primaryColor: Colors.black, primaryColorLight: Colors.grey, accentColor: Colors.blue,