Closed JakeHadley closed 3 years ago
Hi @JakeHadley 👋 Thanks for opening an issue
You can define a copyWith to easily create a copy of your state with one or more updated properties. You can take a look at the weather app for an example https://github.com/felangel/bloc/blob/76268b3e2b7184d79563811eb084cc36efba1e3c/examples/flutter_weather/lib/weather/cubit/weather_state.dart#L27
Hope that helps 👍
Oh, yeah. That helps a lot. Thanks!
Hey Felix, great package, trying to learn flutter and bloc is helping a ton. I've gotten through implementing bloc no problem, but I have a question about complex state that I haven't been able to find many answers for on the interwebs. I have a state object that I'm wanting to have a few class members on. When I start the app, I want all members of the state object to be initialized and that state returned. Later on, I want to update that state object, but only updating one of the class members. Is this an anti-pattern of sorts?
Some example code here:
What's the best way to go about this?