Closed bhavikvashi1804 closed 4 years ago
1st refresh work completely 2nd refresh goes to stuck
Hi @bhavikvashi1804 👋 Thanks for opening an issue!
That's because the second time you refresh the state stays the same from the bloc so no transition occurs. In order to resolve this you can either remove Equatable
from your WeatherState
or add a lastUpdated
property to your Weather
model as is done here:
https://github.com/felangel/bloc/blob/b9e31f33c3082c611929729208fbcf89828954b5/examples/flutter_weather/lib/models/weather.dart#L64
That will ensure that whenever you request weather it will always be different and trigger a state change.
Hope that helps 👍
https://github.com/bhavikvashi1804/flutter_BLoC_Weather_App
check this repository, I have made this by my own with the help of bloclibrary
Pull to refresh does not work, always go to an infinite loop.