browser_launcher 0.1.5

Build Status

Provides a standardized way to launch web browsers.

Currently, Chrome is the only supported browser.

Support for other browsers will be added in the future.

0.1.5 #

  • Add a parameter to use a specified user-data-dir instead of a system temp.

0.1.4 #

  • Start Chrome maximized.

0.1.3 #

  • widen the version constraint on package:webkit_inspection_protocol

0.1.2 #

  • lower min sdk version to match Flutter stable

0.1.1 #

  • added example

0.1.0 #

  • initial release


import 'package:browser_launcher/browser_launcher.dart';

const _googleUrl = '';
const _googleImagesUrl = '';

Future<void> main() async {
  // Launches a chrome browser with two tabs open to [_googleUrl] and
  // [_googleImagesUrl].
  await Chrome.start([_googleUrl, _googleImagesUrl]);
  print('launched Chrome');

  // Pause briefly before opening Chrome with a debug port.
  await Future.delayed(Duration(seconds: 3));

  // Launches a chrome browser open to [_googleUrl]. Since we are launching with
  // a debug port, we will use a variety of different launch configurations,
  // such as launching in a new browser.
  final chrome = await Chrome.startWithDebugPort([_googleUrl], debugPort: 8888);
  print('launched Chrome with a debug port');

  // When running this dart code, observe that the browser stays open for 3
  // seconds before we close it.
  await Future.delayed(Duration(seconds: 3));

  await chrome.close();
  print('closed Chrome');

Use this package as a library

1. Depend on it

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

  browser_launcher: ^0.1.5

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:browser_launcher/browser_launcher.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 Feb 13, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.2-dev.0.0 <3.0.0
path ^1.6.2 1.6.4
webkit_inspection_protocol >=0.4.0 <0.6.0 0.5.0
Transitive dependencies
logging 0.11.4
Dev dependencies
pedantic ^1.5.0
test ^1.0.0