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

Update readme example #10

Merged
merged 3 commits into from
May 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/url-launcher/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.3.1] - 2017-05-01

* Change to README.md

## [0.3.0] - 2017-04-27

* Add `canLaunch` method.
Expand Down
11 changes: 8 additions & 3 deletions packages/url-launcher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@ void main() {
runApp(new Scaffold(
body: new Center(
child: new RaisedButton(
onPressed: launchURL,
onPressed: _launchURL,
child: new Text('Show Flutter homepage'),
),
),
));
}

launchURL() {
launch('https://flutter.io');
_launchURL() async {
const url = 'https://flutter.io';
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}

```
Expand Down
6 changes: 3 additions & 3 deletions packages/url-launcher/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class _MyHomePageState extends State<MyHomePage> {
if (await canLaunch(url)) {
await launch(url);
} else {
throw "Could not launch $url";
throw 'Could not launch $url';
}
}

Expand All @@ -72,11 +72,11 @@ class _MyHomePageState extends State<MyHomePage> {
children: [
new Padding(
padding: new EdgeInsets.all(16.0),
child: new Text("https://flutter.io"),
child: new Text('https://flutter.io'),
),
new RaisedButton(
onPressed: _launchUrl,
child: new Text("Go"),
child: new Text('Go'),
),
],
),
Expand Down