skip to Main Content

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.

2

Answers


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

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search