How can I change ripple effect color in Flutter?
Wrap your widget in Theme
and provide the data
as
data: ThemeData(splashColor: Colors.red)
An example for the @CopsOnRoad's answer. (Like-Button)
Theme(
data: ThemeData(splashColor: Colors.red[200]),
child: Material(
elevation: 0,
shape: CircleBorder(),
clipBehavior: Clip.hardEdge,
color: Colors.transparent,
child: InkWell(
child: Padding(
padding: const EdgeInsets.all(10),
child: Icon(
Icons.favorite,
color: _isLiked ? Colors.red : Colors.black12,
size: 20,
),
),
onTap: () {
if(_isLiked){
setState(() {
_isLiked = false;
//You backend state manage code
});
}else{
setState(() {
_isLiked = true;
//You backend state manage code
});
}
},
),
),
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With