title: Changing Color of Floating Action Button Flutter
body: <p>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.</p>
  
  <pre><code> 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),
      );
  </code></pre>