launchInAppWebView function

Future<void> launchInAppWebView(
  1. Uri url, {
  2. Map<String, String> headers = const <String, String>{},
})

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';
  }
}