launchURL function

dynamic launchURL(
  1. dynamic url
)

Implementation

launchURL(url) async {
  if (await canLaunch(url)) {
    await launch(url);
  } else {
    throw 'Could not launch $url';
  }
}