android – Flutter inappwebview shouldoverride url loading not working


In my app, i am using flutter inappwebview to load url, but i found out that mailto:,tel:,sms: url can not be loaded in the browser, i did my research and used the useShouldOverrideUrlLoading property in webview , but it do not seem to work.

initialOptions: InAppWebViewGroupOptions(
                      crossPlatform: InAppWebViewOptions(
                        useShouldOverrideUrlLoading: true,
                      android: AndroidInAppWebViewOptions(
                            Theme.of(context).brightness == Brightness.dark
                                ? AndroidForceDark.FORCE_DARK_ON
                                : AndroidForceDark.FORCE_DARK_OFF,
                        useHybridComposition: widget.useHybridComposition,
                        (InAppWebViewController controller,
                            NavigationAction shouldOverrideUrl) async {
                      print('this is an intercept');
                      Uri url = shouldOverrideUrl.request.url;
                      String action = url.scheme;
                      List<String> customActions = [
                      if (!customActions.contains(action)) {
                        if (await canLaunch(url.toString())) {
                          await launch(url.toString());
                        return NavigationActionPolicy.CANCEL;
                      return NavigationActionPolicy.ALLOW;

the version of flutter_inappwebview

flutter_inappwebview: ^5.4.3+7