View lifecycle control improvements #56
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The motivation of this PR is to correct delegate the control of
View
life cycle to controller, toensure the correct usage of chain of responsability. With those changes, the usage of
didChangeViewDependencies
andinitViewState
were deprecated to be removed in next release, and wascreated some life cycle controllers on
Controller
to correct control view statesIt was created:
onDeactivated
onReassembled
onInitState
onDidChangeDependencies
To ensure correct control of view life cycles and avoid the need of inject controller inside view unecessarely
Also, due to unsafe usages of uncorrect context. It was removed injection of
BuildContext
ononDisposed
life cycle. We suggest the usage of what is need the context ononDeactivated
life cycle, that occurs right beforedispose
and presents a more safe usage of contextDeveloper checklist
For reviewers
All PR's needs at least one reviewer to be merged.
Before merge this PR confirm that it meets all requirements listed below: