openUrl method

dynamic openUrl(
  1. String url, {
  2. String webOnlyWindowName = "_blank",
})

Implementation

openUrl(String url, {String webOnlyWindowName = "_blank"}) async {
  String newUrl = url;

  if (!newUrl.contains('https://') && !newUrl.contains('http://')) {
    newUrl = "https://${(newUrl)}";
  }
  await launchUrl(
    Uri.parse(newUrl),
    webOnlyWindowName: webOnlyWindowName,
  );
}