Is there a way to change the raised button background color to a gradient? if not, how can I achieve something like this?
You can use a more easier way by using RawMaterialButton
from material.dart
, you can make it's shape as rounded or circle too .
here is a simple example of this .
Card(
elevation: 7,
child: Container(
width: 120.0,
height: 75.0,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.bottomLeft,
end: Alignment.topRight,
colors: [
Colors.blue,
Colors.red,
],
),
),
child: RawMaterialButton(
onPressed: () {},
splashColor: Colors.grey,
child: Text(
"Button",
style: TextStyle(color: Colors.white, fontSize: 20.0),
),
),
),
),