Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 71cc3d9

Browse files
authored
Update url_launcher README (#4)
1 parent 8156e8d commit 71cc3d9

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

packages/url-launcher/README.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,45 @@
11
# url_launcher
22

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

5-
## Getting Started
5+
## Usage
6+
To use this plugin, add url_launcher as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).
7+
8+
### Example
9+
10+
``` dart
11+
import 'package:flutter/material.dart';
12+
import 'package:url_launcher/url_launcher.dart';
13+
14+
void main() {
15+
runApp(new Scaffold(
16+
body: new Center(
17+
child: new RaisedButton(
18+
onPressed: launchURL,
19+
child: new Text('Show Flutter homepage'),
20+
),
21+
),
22+
));
23+
}
24+
25+
launchURL() {
26+
UrlLauncher.launch('https://flutter.io');
27+
}
28+
29+
```
30+
31+
## Supported URL schemes
32+
33+
The `launch` method takes a string argument containing a URL. This URL
34+
can be formatted using a number of different URL schemes. The supported
35+
URL schemes depend on the underlying platform and installed apps.
36+
37+
Common schemes supported by both iOS and Android:
38+
39+
* http:<URL> , https:<URL>
40+
* mailto:<email-address>
41+
* tel:<phone-number>
42+
* sms:<phone-number>
43+
44+
More details can be found here for [iOS](https://developer.apple.com/library/content/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html) and [Android](https://developer.android.com/guide/components/intents-common.html)
645

7-
Try out the plugin by running the project in the example/ folder.

0 commit comments

Comments
 (0)