import 'package:url_launcher/url_launcher.dart'; const url = "https://flutter.io"; if (await canLaunchUrl(url)) await launchUrl(url); else // can't launch url, there is some error throw "Could not launch $url";