capture static method
Captures the nearest LevitScope from context and re-provides it to
another subtree.
This is useful for dialogs, overlays, and other route subtrees that are no longer descendants of the original LScope widget tree.
If no local scope is found, child is returned unchanged.
Implementation
static Widget capture(
BuildContext context, {
required Widget child,
}) {
final scope = _ScopeProvider.of(context);
if (scope == null) return child;
return _CapturedScope(
scope: scope,
child: child,
);
}