I'm working with an API to create a movie app with flutter. I'm using the Bloc library for state management but I have an issue displaying the json response on my UI because flutter somehow thinks the list is empty even though the json list prints in the console and its not empty.
I've searched for answers online and some people suggest and I've tried every solution but it hasn't worked. I'll appreciate if anyone can help check the code and point out wgere my mistake is. The code has gotten a little complicated and I don't think I can just paste the code here.
https://github.com/darmhey/movie_app
The most logical solution I've come across is that I'm referencing the list before it is fetched from the API but it still seems I don't know how I can solve it. I have something like if list.empty return a, else return b. it returns a always