launchInAppWebView function
Launch Uri in InAppWebView
.
Implementation
Future<void> launchInAppWebView(
Uri url, {
Map<String, String> headers = const <String, String>{},
}) async {
if (!await launchUrl(
url,
mode: LaunchMode.inAppWebView,
webViewConfiguration: WebViewConfiguration(
// Additional headers to pass in the load request.
headers: headers,
),
)) {
throw 'Could not launch $url';
}
}