launchWeb static method

Future<void> launchWeb(
  1. Uri uri
)

Implementation

static Future<void> launchWeb(Uri uri) async {
  if (await AppUtils.isNetConnected()) {
    if (await canLaunchUrl(uri)) {
      await launchUrl(
        uri,
        mode: LaunchMode.externalApplication,
      );
    } else {
      throw "Could not launch $uri";
    }
  } else {
    toToast(getTranslated("noInternetConnection"));
  }
}