launchInBrowser function
Implementation
Future<void> launchInBrowser(String url) async {
if (await AppUtils.isNetConnected()) {
var webUrl = url.replaceAll("http://", "").replaceAll("https://", "");
final Uri toLaunch = Uri(scheme: 'https', host: webUrl);
if (!await launchUrl(
toLaunch,
mode: LaunchMode.externalApplication,
)) {
throw 'Could not launch $url';
}
} else {
toToast(getTranslated("noInternetConnection"));
}
}