felangel / felangel/bloc

Hydrated Bloc only if recovering from tombstoning

Open
#2,087 0 comments 1 reaction 1 assignee Claimed by @felangel View on GitHub
investigating pkg:hydrated_bloc
Dominant language
Dart
Stars
12.5k
Forks
3.4k
PR merge metrics
No merged PRs in 30d

Description

**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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.