Closed
Description
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.