launchUrl function
Future<bool>
launchUrl(
- Uri url, {
- LaunchMode mode = LaunchMode.platformDefault,
- WebViewConfiguration webViewConfiguration = const WebViewConfiguration(),
- String? webOnlyWindowName,
Implementation
Future<bool> launchUrl(
Uri url, {
LaunchMode mode = LaunchMode.platformDefault,
WebViewConfiguration webViewConfiguration = const WebViewConfiguration(),
String? webOnlyWindowName,
}) async {
if (mode == LaunchMode.inAppWebView &&
!(url.scheme == 'https' || url.scheme == 'http')) {
throw ArgumentError.value(url, 'url',
'To use an in-app web view, you must provide an http(s) URL.');
}
return UrlLauncherPlatform.instance.launchUrl(
url.toString(),
LaunchOptions(
mode: convertLaunchMode(mode),
webViewConfiguration: convertConfiguration(webViewConfiguration),
webOnlyWindowName: webOnlyWindowName,
),
);
}