You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: packages/url-launcher/README.md
+41-3Lines changed: 41 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,45 @@
1
1
# url_launcher
2
2
3
-
A Flutter plugin for launching a URL.
3
+
A Flutter plugin for launching a URL in the mobile platform. Supports iOS and Android.
4
4
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)
6
45
7
-
Try out the plugin by running the project in the example/ folder.
0 commit comments