Skip to content

Allow depending on ModalRoute.popDispositionOf(context) #162009

Closed
@timcreatedit

Description

@timcreatedit

Use case

I want to implement a custom widget that can close the current route using a gesture. One of my requirements is that the gesture is not accepted, if the current route can't be popped using a gesture (aka its popDisposition is .doNotPop).

Unfortunately, I found no way to keep my widget updated, since depending on ModalRoute.of(context) doesn't trigger a rebuild when the popDisposition changes, and its Notifications bubble upwards, so the route's contents can't receive them.

Proposal

Add popDisposition as an aspect to the respective InheritedModel so that we can depend on it reliably.

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 Flutterf: routesNavigator, Router, and related APIs.frameworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions