openUrl function

Future<void> openUrl(
  1. String url
)

Opens the specified url in the system's default browser.

Supports Windows ('start') and macOS ('open').

Implementation

Future<void> openUrl(String url) async {
  if (Platform.isWindows) {
    await Process.run('start', [url], runInShell: true);
  } else if (Platform.isMacOS) {
    await Process.run('open', [url]);
  } else {
    print('🌐 Please open: $url');
  }
}