launchInWebViewOrVC static method

Future<void> launchInWebViewOrVC(
  1. String url,
  2. String title
)

Implementation

static Future<void> launchInWebViewOrVC(String url, String title) async {
  if (await AppUtils.isNetConnected()) {
    if (!await launchUrl(
      Uri.parse(url),
      mode: LaunchMode.inAppWebView,
      webViewConfiguration: WebViewConfiguration(
          headers: <String, String>{'my_header_key': title}),
    )) {
      throw Exception('Could not launch $url');
    }
  } else {
    toToast(getTranslated("noInternetConnection"));
  }
}