routeBuilder static method

Widget Function(Widget) routeBuilder(
  1. BuildContext source
)

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);
}