Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Error: Can't assign to the final variable 'color'. assert(color = null || decoration == null, ^^^^^

I can’t run even a simple code. I think the problem is with the container. dart
 this is first picture

This is the full picture in debug console. I am doing flutter for 1 month. Can someone help me out?
This is second Picture

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Somehow you’ve corrupted your Flutter install. That line 274 is meant to say color == null not color = null

   assert(color == null || decoration == null,
     'Cannot provide both a color and a decoration\n'
     'To provide both, use "decoration: BoxDecoration(color: color)".',
   ),

You can just correct that back, but you may want to remove and reinstall Flutter, just in case there are other corruptions.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading