Answers for "Elevated button in flutter background color"

6

Flutter Elevated button color

ElevatedButton(
            child: Text('Button'),
            onPressed: () {},
            style: ButtonStyle(
                backgroundColor: MaterialStateProperty.all(Colors.red),
                padding: MaterialStateProperty.all(EdgeInsets.all(50)),
                textStyle: MaterialStateProperty.all(TextStyle(fontSize: 30))),
),
Posted by: Guest on June-01-2021
0

add background color to button flutte

bool isButtonPressed = false;

RaisedButton(
            color: isButtonPressed ? Colors.green : Colors.red,
            onPressed: () {
              setState(() {
                isButtonPressed =!isButtonPressed;
              });
            },
          ),
Posted by: Guest on February-04-2021

Code answers related to "Elevated button in flutter background color"

Browse Popular Code Answers by Language