Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add hook to observe didChangeDependencies #397

Copy link
Copy link
@water-mizuu

Description

@water-mizuu
Issue body actions

Is your feature request related to a problem? Please describe.
Basically, I have a complicated [Widget] which uses [didChangeDependencies] to update state intricately. This involves animations, and with it, comes asynchronous functions. I would like to allow hooks to listen to lifecycle method [didChangeDependencies] as hooks can to [initState] and [dispose], additionally helping parallel the [State] object of [Widgets].

Now, why wouldn't it be applicable to being put in [build] instead? Because I don't want [didChangeDependencies], (and the code inside it) to be run on every [setState]. It should only run when the dependencies it has from providers update.

Describe the solution you'd like
As described above, just modify the [HookElement] mixin to allow listening to [didChangeDependencies] on each hook. I could do this on a local version of the library, but it would be nice to have it as an official change.

Describe alternatives you've considered
None.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.