title: flutter how to change the color of a button on a click
body: <p>I am trying to change the color of the button when I click on it. Can you help me because I really can't do it. Thank you.</p>
  
  <pre><code> Container(
  
          child: new Row(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: &lt;Widget&gt;[
                new MaterialButton(
                    child: new Text("1"),
                    color: Colors.greenAccent,
                  splashColor: Colors.red,
                    onPressed:  (){
                      test=0;
                      test=1;
  
  
  
  },
  
  
  
  
   ),
                new MaterialButton(
                  child: new Text("2"),
                    color: Colors.greenAccent,
                      onPressed: (){
                      test=0;
                      test=2;
  
  },
  </code></pre>