cris uriarte
cris uriarte

Reputation: 11

The named parameter 'color' isn't defined for ElevatedButton

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.

Upvotes: 1

Views: 123

Answers (2)

b_arf
b_arf

Reputation: 17

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.

Upvotes: 0

Anton Vikhlyaev
Anton Vikhlyaev

Reputation: 23

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(...),

Upvotes: 1

Related Questions