title: Class marked as @immutable, instance field not final using StatefulWidget
body: <p>I have a Stateless widget called ToggleButtonsList and one of my instance fields, isSelectedType, is not set to final. This is the warning I am receiving because of this:</p>
  <p>&quot;This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: ToggleButtonsList.isSelectedType&quot;</p>
  <p>Here is a portion of my code:</p>
  <pre><code>class ToggleButtonsList extends StatefulWidget {
    ToggleButtonsList({this.type, this.stringList});
  
    final String type;
    final List&lt;String&gt; stringList;
    List&lt;bool&gt; isSelectedType = [];
  
    @override
    _ToggleButtonsListState createState() =&gt; _ToggleButtonsListState();
  }
  
  class _ToggleButtonsListState extends State&lt;ToggleButtonsList&gt; {
    @override
    Widget build(BuildContext context) {
     
     
    }
  }
  </code></pre>
  <p><strong>My question:</strong> I thought instance fields needed to be set to final <strong>only for Stateless widgets, NOT Stateful Widgets</strong>. Is this true? Is this a warning I should worry about since I'm not using a StatelessWidget or can I ignore it? My app seems to be working perfectly fine when I ignore the warning.</p>
  <p>Reading the <strong>&quot;or a class that this class inherits from&quot;</strong> part of the warning made me try searching my project for any StatelessWidgets this class may inherit from and the only StatelessWidget I have in my project is from my main.dart :</p>
  <pre><code>class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      
      return MaterialApp(
        theme: ThemeData.dark().copyWith(
            primaryColor: Colors.blueGrey,
            scaffoldBackgroundColor: Colors.blueGrey),
        home: PriceScreen(),
      );
    }
  }
  </code></pre>
  <p>Changing my MyApp class to a StatefulWidget didn't get rid of the warning.</p>