I\'m having list of Movies. That contains all Animated & non Animated Movies. To identify whether its Animated or not there is one flag called as isAnimated
You can use toList() method to get your desire output like following
toList()
Collects all elements of this stream in a List
.
To fix the above issue:
Add a toList()
(This code creates a List
)
_AnimatedMovies = AllMovies.where((i) => i.isAnimated).toList();
instead of
_AnimatedMovies = AllMovies.where((i) => i.isAnimated);