Home > OS >  Error: Can't assign to the final variable 'color'. assert(color = null || decoration
Error: Can't assign to the final variable 'color'. assert(color = null || decoration

Time:12-06

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

CodePudding user response:

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.

  • Related