I have a LoadedState that runs in my cubit perfectly, until I try and filter the data it is about to display, as it doesn't run that code at all! It skips all the for loop and goes straight to return.
else if (state is LoadedState) {
var matches = state.matches;
for (var i = widget.selectedFilters.length; i < widget.selectedFilters.length; i++) {
print("111");
if (matches[i].leagueNumber == widget.selectedFilters[i]) {
print("222");
matches.removeAt(i);
}
}
print("333");
return Container(
The output in the logs is just 333.
Does anybody know why this is? Thanks