openUrl static method

Future<void> openUrl(
  1. String url,
  2. bool useExternalBrowser
)

Implementation

static Future<void> openUrl(String url, bool useExternalBrowser) async {
  final Uri urlFinal = Uri.parse(url);
  if (!await launchUrl(
    urlFinal,
    mode: useExternalBrowser
        ? LaunchMode.externalApplication
        : LaunchMode.platformDefault,
  )) {
    throw Exception('Could not launch $url');
  }
}