RaisedButton color is not changing in Flutter

I am trying to change the background color of RaisedButton in Flutter but it is not changing at all. Can you please help me out. I am using the following code.

RaisedButton.icon(
  onPressed: null
  icon: Icon(Icons.refresh),
  label: Text('Login'),
  color: Color(0xffFF0000),
),
1 Answers

The issue may be because of onPressed method as you are passing null to it. It will not work until you pass null to it. The below code can help you to add color.

RaisedButton.icon(
  onPressed: () { print("hello") }
  icon: Icon(Icons.refresh),
  label: Text('Login'),
  color: Color(0xffFF0000),
),
Ask question now
Never leave your website again in search of code snippets by installing our chrome extension.