browser_launcher 0.1.2

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.2 #

  • lower min sdk version to match Flutter stable

0.1.1 #

  • added example

0.1.0 #

  • initial release

example/main.dart

import 'package:browser_launcher/browser_launcher.dart';

const _googleUrl = 'https://www.google.com/';
const _googleImagesUrl = 'https://www.google.com/imghp?hl=en';

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:


dependencies:
  browser_launcher: ^0.1.2

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';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
64
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
80
Learn more about scoring.

We analyzed this package on Aug 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, other

Primary library: package:browser_launcher/browser_launcher.dart with components: io.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (webkit_inspection_protocol).

Dependencies

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.4.2 0.5.0
Transitive dependencies
args 1.5.2
async 2.3.0
charcode 1.1.2
collection 1.14.12
convert 2.1.1
crypto 2.1.2
http_parser 3.1.3
logging 0.11.3+2
meta 1.1.7
shelf 0.7.5
shelf_web_socket 0.2.3
source_span 1.5.5
stack_trace 1.9.3
stream_channel 2.0.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
web_socket_channel 1.0.15
Dev dependencies
pedantic ^1.5.0
test ^1.0.0