jeudi 27 juillet 2023

The argument Type 'Color' can't be assigned to the parameter type MaterialStateProperty

Hello I am trying to create a custom Checkbox widget to support dark and light themes in app. For that I am trying as below:

   static final CheckboxThemeData primaryLight =CheckboxThemeData(
    fillColor:AppColor.primary 
  );

But At the line AppColor.primary, its giving me compile time error as

"The argument Type 'Color' can't be assigned to the parameter type MaterialStateProperty<Color?>?"

What might be the issue? Or How can I resolve this to make the common custom Checkbox for two different themes?




Aucun commentaire:

Enregistrer un commentaire