This is a weird behaviour that I have noticed while using the package. When using with a page that has other widgets adding events to bloc, I get Bad state: Cannot add new events after calling close error after scrolling down to page 2.
And updated the pagecontroller state in BlocListener
This gave me the "Bad State" error after scrolling down to till page 2, after failing to figure out what went wrong, I removed all bloc dependency for calling the Api, and called it directly from the Api repo. This fixed the issue, and I can scroll till the end. Works like a charm.
But when I tried to refresh the page using refresh indicator, that adds events to the different blocs to refresh other widgets in the page, I get the Bad state error again.
Again, this only happens after I scroll down till page 2 items. If refresh the page without scrolling down, the blocs work fine.
This is a weird behaviour that I have noticed while using the package. When using with a page that has other widgets adding events to bloc, I get Bad state: Cannot add new events after calling close error after scrolling down to page 2.
Initially I was adding fetch event to bloc using:
And updated the pagecontroller state in BlocListener
This gave me the "Bad State" error after scrolling down to till page 2, after failing to figure out what went wrong, I removed all bloc dependency for calling the Api, and called it directly from the Api repo. This fixed the issue, and I can scroll till the end. Works like a charm.
But when I tried to refresh the page using refresh indicator, that adds events to the different blocs to refresh other widgets in the page, I get the Bad state error again.
Again, this only happens after I scroll down till page 2 items. If refresh the page without scrolling down, the blocs work fine.
Below are how my widgets are laid out: