open_url 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 86

open_url #

Simple package to open URLs on the user's default application, using the platform's default utility:

  • start on Windows.
  • xdg-open on Linux.
  • open on MacOS.

This is normally used to display a website on a browser.

This package can only be used when running on the Dart VM.

On Flutter, use the url_launcher package instead.

On the Web, use

1.0.1 #

  • Metadata fixes

1.0.0 #

  • Initial version, created by Stagehand


import 'package:open_url/open_url.dart';

main() async {
  final result = await openUrl('');
  if (result.exitCode == 0) {
    print("URL should be open in your browser");
  } else {
    print("Something went wrong (exit code = ${result.exitCode}): "

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  open_url: ^1.0.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:open_url/open_url.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Apr 8, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.0 <3.0.0
Dev dependencies
pedantic ^1.7.0
test ^1.6.0