openUrl method

Future<bool> openUrl(
  1. String url, {
  2. LaunchMode mode = LaunchMode.platformDefault,
  3. WebViewConfiguration webViewConfiguration = const WebViewConfiguration(),
  4. String? webOnlyWindowName,
})

打开连接 Open the connection

Implementation

Future<bool> openUrl(
  String url, {
  LaunchMode mode = LaunchMode.platformDefault,
  WebViewConfiguration webViewConfiguration = const WebViewConfiguration(),
  String? webOnlyWindowName,
}) async {
  if (await canLaunchUrl(Uri.parse(url))) {
    return await launchUrl(Uri.parse(url),
        mode: mode,
        webOnlyWindowName: webOnlyWindowName,
        webViewConfiguration: webViewConfiguration);
  } else {
    return false;
  }
}