title: Change color property of a material from its parent via InkWell onTap
body: <p>I've created a widget with an InkWell child, and I want to change the color of the widget when the InkWell child is being tapped. Currently I have a _pressed variable in the InkWell class to control the color of the widget:</p>
  
  <pre><code>class ButtonA extends StatefulWidget {
     ButtonA();
     @override
     State createState() =&gt; new ButtonAState();
  }
  
  class ButtonAState extends State&lt;ButtonA&gt; {
     bool _pressed = false;
     Widget build(BuildContext context){
        return new Expanded(
          child: new Material(
              color: _pressed ? Colors.greenAccent : Colors.redAccent,
              child: new InkWell(
                  onTap: () =&gt; (
                     this.setState((){
                     _pressed = true;
                 })),
              ),
            ),
          ),
         }
  </code></pre>
  
  <p>And in the parent, I just import ButtonA and create it like:</p>
  
  <pre><code>new Button()
  </code></pre>
  
  <p>Due to an increasing number of functions that I would love to link to this tapping behavior, I want to be able to change the button color in the parent class instead. I am thinking of passing the tap function into the Button class, so to have something like:</p>
  
  <pre><code>class ButtonA extends StatefulWidget {
     VoidCallback _tap;
  
     ButtonA(this._tap);
     @override
     State createState() =&gt; new ButtonAState();
  }
  </code></pre>
  
  <p>and the InkWell will be:</p>
  
  <pre><code>child: new InkWell(onTap: () =&gt; _tap())
  </code></pre>
  
  <p>In the parent class, I will have a tap function that manipulate button colors and do other stuff.</p>
  
  <p>How should I pass the state of the button to its parent so that maybe I can do something like</p>
  
  <pre><code>  this.colors = Colors.white
  </code></pre>
  
  <p>in the parent class? Is it possible?</p>