routeBuilder static method
Capture ownership while the source is active, before a deferred route builder runs. The builder must never look up a disposed source context.
Implementation
static Widget Function(Widget) routeBuilder(BuildContext source) {
final owner = source
.getInheritedWidgetOfExactType<_InteractionScope>()
?.owner;
return (child) => owner == null
? child
: _InteractionOwnedRoute(owner: owner, child: child);
}