openURL static method

Future<bool> openURL({
  1. String? url = "https://google.com/",
})

Implementation

static Future<bool> openURL({String? url = "https://google.com/"}) async {
  final uri = Uri.parse(url.toNotNull);
  if (await canLaunchUrl(uri)) {
    return await launchUrl(uri);
  } else {
    if (kDebugMode) {
      print("Could not launch $url");
    }
    return false;
  }
}