onNavigationRequest method

Future<NavigationDecision> onNavigationRequest(
  1. NavigationRequest request
)

Implementation

Future<NavigationDecision> onNavigationRequest(
    NavigationRequest request) async {
  if (widget.onNavigationRequest != null) {
    return widget.onNavigationRequest!(request);
  }

  if (request.url == "about:blank" ||
      request.url.startsWith("https://www.google.com/maps/embed/v1/")) {
    return NavigationDecision.navigate;
  }

  await launchUrlString(request.url, mode: LaunchMode.externalApplication);
  return NavigationDecision.prevent;
}