bloc icon indicating copy to clipboard operation
bloc copied to clipboard

Hydrated Bloc only if recovering from tombstoning

Open JohnGalt1717 opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. On a typic entry screen you will have 3 possible ways that the cubit is created:

  1. New (i.e. no id passed in)
  2. Edit (i.e. id passed in)
  3. Rebuild from OS tombstoning the OS and having to recover.

Describe the solution you'd like I want to use hydrated to ONLY handle #3.

That is, if new or edit, I don't want to do anything, but I do want to use this to be able to recover when the app is tombstoned or evicted for memory issues. I'd like to see either functionality added to make it work in that specific case OR a sample that does the same.

Describe alternatives you've considered I thought about show how intercepting the entire chain of the recovery and then only calling hydrate() on the HydrateMixin in that scenario, but I couldn't come up with the right chain of events to make that happen.

JohnGalt1717 avatar Jan 15 '21 20:01 JohnGalt1717