title: How to solve error: 'setState' isn't defined
body: <p>Can you please help me to solve this problem about <code>setState()</code></p>
  <blockquote>
  <p>ERROR:<br />
  The method 'setState' isn't defined for the type 'MyApp'.<br />
  Try correcting the name to the name of an existing method, or defining a method named 'setState'.</p>
  </blockquote>
  <p>CODE:</p>
  <pre><code>return MaterialApp(
        debugShowCheckedModeBanner: false,
        home: Scaffold(
          appBar: AppBar(
            centerTitle: true,
            title: Text('Gestion Produit', ),
            backgroundColor: color1,
          ),
          backgroundColor: color2,
          body: SingleChildScrollView(
            child: Column(
              children: &lt; Widget &gt; [
  
                Container(
                  padding: EdgeInsets.all(20),
                  margin: EdgeInsets.fromLTRB(20, 20, 20, 20),
                  decoration: BoxDecoration(
                    borderRadius: BorderRadius.circular(20),
                    color: color3,
                  ),
                  child: Column(
                    children: [
                      Container(
                        width: double.infinity,
                        height: 30,
                        child: TextFormField(
                          controller: refCon,
                          decoration: new InputDecoration(
                            disabledBorder: InputBorder.none,
                            contentPadding:
                            EdgeInsets.only(left: 15, bottom: 11, top: 11, right: 15),
                            hintText: &quot;Votre Reference&quot;,
                            hintStyle: TextStyle(color: color1),
                          ),
                        ),
                      ),
                      SizedBox(height: 20),
                      Container(
                        width: double.infinity,
                        height: 30,
                        child: TextFormField(
                          controller: qteCon,
                          keyboardType: TextInputType.number,
                          decoration: new InputDecoration(
                            disabledBorder: InputBorder.none,
                            contentPadding:
                            EdgeInsets.only(left: 15, bottom: 11, top: 11, right: 15),
                            hintText: &quot;Votre Quantite&quot;,
                            hintStyle: TextStyle(color: color1),
                          ),
                        ),
                      ),
                      SizedBox(height: 20),
                      Container(
                        width: double.infinity,
                        height: 30,
                        child: TextFormField(
                          controller: puCon,
                          keyboardType: TextInputType.number,
                          decoration: new InputDecoration(
                            disabledBorder: InputBorder.none,
                            contentPadding:
                            EdgeInsets.only(left: 15, bottom: 11, top: 11, right: 15),
                            hintText: &quot;Prix Unitaire&quot;,
                            hintStyle: TextStyle(color: color1),
                          ),
                        ),
                      ),
                      SizedBox(height: 20),
                      RaisedButton(
                        onPressed: () {
                            setState((){
                              ref = refCon;
                              qte = qteCon;
                              pu = puCon;
                            });
                        },
                        color: color2,
                        textColor: color3,
                        disabledColor: Colors.grey,
                        disabledTextColor: Colors.black,
                        padding: EdgeInsets.all(8.0),
                        splashColor: color1,
                        child: Text(
                          &quot;Ajouter Un Produit&quot;,
                          style: TextStyle(fontSize: 20.0),
                        ),
                      )
                    ],
                  ),
                ),
  </code></pre>