title: When is it nesessary to use final for variables in flutter (dart)
body: <p>I am confused as to when its compulsory to use final for variables. </p>
  
  <p>According to documents and answers on StackOverflow,</p>
  
  <blockquote>
    <p>If you make a StatefulWidget subclass with non-final fields, it will result in DartAnalysis warning</p>
  </blockquote>
  
  <p>But I made this class and everything runs fine</p>
  
  <pre><code>class Order extends StatefulWidget {
    int hello = 1;
  
    @override
    _OrderState createState() =&gt; _OrderState();
  }
  
  class _OrderState extends State&lt;Order&gt; {
    pizza _pizzaOrder = new pizza();
  
    void setSize(String value) {
      setState(() {
        _pizzaOrder.size = value;
        print(++widget.hello);
      });
    }
  </code></pre>
  
  <p>I made a simple app and never used final or const anywhere in the program. So is it compulsory anywhere that I must use "final"/"const"? Or is just for optimization? 
  And when should I use "final"? </p>