在Flutter中,我使用flutter webview插件来启动一个类似于以下的url:
flutterWebviewPlugin.launch(url)
或者
WebviewScaffold(
url: url,
appBar: new AppBar(title: Text(title), actions: [
new IconButton(
icon: const Icon(Icons.share),
onPressed: () => Share.share(url),
)
]),
withZoom: true,
withLocalStorage: true,
withJavascript: true,
);
然而,如果打开的网页中有任何应用程序链接,比如:fb://profile,我会收到net::ERR_UNKNOWN_URL_SCHEME错误。
在安卓中,我发现解决方法是重写shouldOverrideUrlLoading,就像这里提到的那样,但是在flutter中该怎么办呢?