url_launcher 0.2.0

url_launcher

A Flutter plugin for launching a URL in the mobile platform. Supports iOS and Android.

Usage

To use this plugin, add url_launcher as a dependency in your pubspec.yaml file.

Example

import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';

void main() {
  runApp(new Scaffold(
    body: new Center(
      child: new RaisedButton(
        onPressed: launchURL,
        child: new Text('Show Flutter homepage'),
      ),
    ),
  ));
}

launchURL() {
  launch('https://flutter.io');
}

Supported URL schemes

The launch method takes a string argument containing a URL. This URL can be formatted using a number of different URL schemes. The supported URL schemes depend on the underlying platform and installed apps.

Common schemes supported by both iOS and Android:

  • http:<URL> , https:<URL>
  • mailto:<email-address>
  • tel:<phone-number>
  • sms:<phone-number>

More details can be found here for iOS and Android

[0.2.0] - 2017-04-24

  • Change launch to a top-level method instead of a static method in a class.

[0.1.1] - 2017-04-21

  • Change to README.md

[0.1.0] - 2017-04-20

  • Initial Open Source release.

1. Depend on it

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

dependencies:
  url_launcher: "^0.2.0"

2. Install it

You can install packages from the command line:

$ pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:url_launcher/url_launcher.dart';

About

Flutter plugin for launching a URL

Author

Email flutter-dev@googlegroups.com Flutter Team

Homepage

github.com/flutter/plugins

Documentation

www.dartdocs.org/documentation/url_launcher/0.2.0/

Source code (hyperlinked)

www.crossdart.info/p/url_launcher/0.2.0/

Uploader

zarah@google.com

Share