I want to change Color of my floating button when i hit that button but couldn't find out a way to do that, how can i solve it? thanks in advance.
var color1;
var floatingActionButton1 = FloatingActionButton(
onPressed: () {
setState(() {
simpleInterest.principal = double.parse(_principalController.text);
color1 = Colors.green;
});
},
elevation: 40,
backgroundColor: color1,
heroTag: "btn1",
child: Icon(Icons.check),
);