Skip to content
pubscout

open_url

2.0.1, released 4 years ago by an unverified publisher

Open a URL with the system's default application on Dart VM platforms.

$ flutter pub add open_url
Source repository

What it does

Calls the OS utility (start, xdg-open, open) to launch a URL in the default handler. Works on Android, iOS, Windows, macOS, and Linux when running on the Dart VM. Not usable in Flutter projects, which should use url_launcher instead.

AI-written summary of version 2.0.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Running pure Dart code on the VM and need to open a web page or file with the default system app
  • You need a lightweight solution without pulling in Flutter dependencies

Skip it when

  • Developing a Flutter app (use url_launcher)
  • Targeting the web (use window.open)
  • Needing advanced features like checking if a URL can be launched

Strengths

  • Zero Flutter dependencies
  • Works on all major desktop platforms
  • Simple API

Weaknesses

  • Only works on Dart VM, not in Flutter or web
  • No ability to check launch availability
  • No callbacks for success/failure

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:open_url/open_url.dart';

void main() {
  openUrl('https://example.com');
}

Alternatives

Packages that do the same job and could replace open_url.

  • url_launcher

    Provides the same functionality for Flutter apps and supports web, with additional launch checks