Home > OS >  flutter visual studio
flutter visual studio

Time:12-14

the color is not recognize by the VScode(flutter)

The named parameter 'color' isn't defined. Try correcting the name to an existing named parameter's name, or defining a named parameter with the name 'color'.dartundefined_

enter image description here

I tried a lot of searching and doing all things from my end like cleaning and restarting.

CodePudding user response:

ElevatedButton has no color property.

This widget has the following properties for color control:

  • backgroundColor,
  • foregroundColor,
  • overlayColor,
  • shadowColor,
  • surfaceTintColor.

To configure them, add the property: style: ButtonStyle(...),

CodePudding user response:

Check the documentation of ElevatedButton.

It has no color attribute.

As you're working on Visual Studio, you can always hover on the class name and it will give a list of all the attributes of that widget.

  • Related