of static method

PortalLinkScope? of(
  1. BuildContext context,
  2. List<PortalLabel> portalCandidateLabels
)

Implementation

static PortalLinkScope? of(
  BuildContext context,
  List<PortalLabel<dynamic>> portalCandidateLabels,
) {
  for (final portalLabel in portalCandidateLabels) {
    final scope =
        context.dependOnSpecificInheritedWidgetOfExactType<PortalLinkScope>(
            (scope) => scope.portalLabels.contains(portalLabel));
    if (scope != null) {
      return scope;
    }
  }
  return null;
}