title: setState() is not recognizing in the statefulWidget class
body: <pre><code>class DataItem extends StatefulWidget {
    @override
    String number;
  
    void setNumber(String nu){
      setState(() {
        this.number=nu;
      });
    }
  
    _DataItemState createState() =&gt; new _DataItemState(this.number);
  }
  
  class _DataItemState extends State&lt;DataItem&gt; {
    @override
  
    String number;
  
    _DataItemState(this.number);
    Widget build(BuildContext context) {
      return new Container(
        child: Text(
            number,
          style: TextStyle(...),
      );
    }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/YbrbQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YbrbQ.png" alt="Screenshot"></a></p>
  
  <p>Please note that I am getting setState() is not defined with the above setup in the StatefulWidget (DataItem) however what I want to be done is following according to the attached screenshot. Once I pressed the button I need to update the labels accordingly.</p>