title: The function setState is not defined. Flutter
body: <p>I'm trying to change the colour of my checkbox(actually custom checkbox) for this I have written the code below , while I press the icon the <code>onPressed()</code> method is called but the colour of the icon doesn't change at all.</p>
  
  <p>My widgets <code>setState()</code> is un-recognized. I have included <code>import package:flutter/material.dart</code></p>
  
  <p>here's the code</p>
  
  <pre><code>Widget _choice() {
  var isPressed = false;
  return Container(
  height: 90,
  width: 160,
  color: Color(0xFFe6e9ed),
  child: Column(
    children: &lt;Widget&gt;[
      Align(
        alignment: Alignment(0.9, 0),
        child: IconButton(
          icon: Icon(
            Icons.check_circle,
            size: 25,
              color:(isPressed) ? Color(0xff007397) : Color(0xff9A9A9A)
          ),
        onPressed: (){
          setState((){ // &lt;--  this setState is un-recognizable by flutter ide
            if(isPressed){ print("checkbox pressed");
            isPressed = false;
            } else {
              isPressed = true;
            }
          });
        },
        ),
      ),
      Align(
        alignment: Alignment(-0.8, 0),
        child: Text("Category choice 1"),
      ),
      Align(
        alignment: Alignment(0.9, 0),
        child: Icon(
          Icons.phonelink,
          size: 40,
        ),
      ),
    ],
  ),);}
  </code></pre>