Answers for "button style flutter"

2

flutter raisedbutton example

RaisedButton(child: Text("Rock & Roll"),
                onPressed: _changeText,
                color: Colors.red,
                textColor: Colors.yellow,
                padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
                splashColor: Colors.grey,
              )
Posted by: Guest on April-15-2020
3

text button flutter style

TextButton(
	child: Text('Text'),
    style: TextButton.styleFrom(primary: Colors.blue),
    onPressed: () {
    	print('Pressed');
    },
)
Posted by: Guest on June-08-2021
1

flutter button style

ElevatedButton(
  style: ButtonStyle(
    backgroundColor: MaterialStateProperty.resolveWith<Color>(
      (Set<MaterialState> states) {
        if (states.contains(MaterialState.pressed))
          return Theme.of(context).colorScheme.primary.withOpacity(0.5);
        return null; // Use the component's default.
      },
    ),
  ),
)
Posted by: Guest on April-21-2021

Browse Popular Code Answers by Language