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