title: Flutter - Count List with bool
body: <p>In Flutter I've created a List with booleans.</p>
  
  <pre><code>List&lt;bool&gt; name = [false, false, false]
  </code></pre>
  
  <p>The Values change to true on a togglebutton click.</p>
  
  <p>How is it possible to count the values on reloading the page?</p>
  
  <p>My attempt was inside the initState to count the List if it contains true.</p>
  
  <pre><code>value = name.contains(true).length
  </code></pre>
  
  <p>But it always says length isn't defined for the class 'bool'.</p>
  
  <p>How can I count it on reload of the page?</p>
  
  <p>Thanks in advance!</p>