launchWebsite function

dynamic launchWebsite({
  1. required String website,
  2. String scheme = "https",
  3. String query = "",
})

Implementation

launchWebsite({
  required String website,
  String scheme = "https",
  String query = "",
}) async {
  Uri url = Uri(
    scheme: scheme,
    path: website,
    query: query,
  );

  if (await canLaunchUrl(url)) {
    await launchUrl(url);
  } else {
    print('Could not launch');
  }
}