launchUrl static method

dynamic launchUrl(
  1. dynamic url, {
  2. LaunchMode mode = LaunchMode.platformDefault,
})

Opens the given url in the default browser.

Implementation

static launchUrl(url, {LaunchMode mode = LaunchMode.platformDefault}) async {
  if (await canLaunchUrlString(url)) {
    await launchUrlString(
      url,
      mode: mode,
    );
  } else {
    showErrorNotice("Error", "Could not launch the $url");
    throw 'Could not launch';
  }
}