Is there a way to change the raised button background color to a gradient? if not, how can I achieve something like this?
Simply make one more container as a child set the decoration of that container and make gradient color as you want
Then after this use RaisedButton as the child of the above container same as with MaterialButton also
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.red, Colors.blue],
begin: FractionalOffset(0.0, 0.0),
end: FractionalOffset(0.5, 0.0),
stops: [0.0, 1.0],
tileMode: TileMode.clamp),
),
child: RaisedButton(
color: Colors.transparent,
child: Text("Ask Permssion"),
onPressed: () {
askPermission();
},
)),
Output: