Skip to content

There's no way for InheritedElement to know that a dependent has been deactivated #129207

@s0nerik

Description

@s0nerik

Is there an existing issue for this?

Use case

I'm finishing the promising-looking, easy-to-use approach to state management, which requires that InheritedElement is notified when the dependent has been removed from the dependents list to properly close all value change subscriptions upon dependent element deactivation.

Proposal

Call the dependency.onDependentRemoved(this) right after dependency._dependents.remove(this) inside the Element.deactivate()

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions