Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View lifecycle control improvements #56

Merged
merged 7 commits into from
Jan 4, 2021
Merged

Conversation

rafaelcmm
Copy link
Collaborator

Description

The motivation of this PR is to correct delegate the control of View life cycle to controller, to
ensure the correct usage of chain of responsability. With those changes, the usage of didChangeViewDependencies and initViewState were deprecated to be removed in next release, and was
created some life cycle controllers on Controller to correct control view states

It 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 on onDisposed life cycle. We suggest the usage of what is need the context on onDeactivated life cycle, that occurs right before dispose and presents a more safe usage of context

Developer checklist

  • All github actions are passing.

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:

  • The PR has good quality code and has tests (if is the case)
  • This PR is not checked with WIP on title

@rafaelcmm rafaelcmm added the enhancement New feature or request label Dec 17, 2020
@rafaelcmm rafaelcmm self-assigned this Dec 17, 2020
@rafaelcmm rafaelcmm mentioned this pull request Dec 17, 2020
joaopereirajp
joaopereirajp previously approved these changes Dec 17, 2020
@ShadyBoukhary ShadyBoukhary merged commit aa43746 into master Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants