Skip to content

How to insure a provider with autoDispose + family is disposed before another is initialized #893

@trevhud

Description

@trevhud

Describe what scenario you think is uncovered by the existing examples/articles

I have a autoDispose family future provider that is watched in a widget. When the family argument changes, the widget is rebuild with the new argument and the new instance of the provider is initialized. After that, the previous instance referenced by the previous argument is disposed. It is unclear how I would make sure that onDispose is called on the first instance before the second is created.

Describe why existing examples/articles do not cover this case

The family and autoDispose documentation does not describe this potential problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions