From a9f6128da43530c5b91609f05bf2a923ae5d423f Mon Sep 17 00:00:00 2001 From: Sarah Zakarias Date: Mon, 1 May 2017 09:46:07 +0200 Subject: [PATCH 1/3] update README example --- packages/url-launcher/CHANGELOG.md | 4 ++++ packages/url-launcher/README.md | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/url-launcher/CHANGELOG.md b/packages/url-launcher/CHANGELOG.md index 4c98b259cf8f..2055076850aa 100644 --- a/packages/url-launcher/CHANGELOG.md +++ b/packages/url-launcher/CHANGELOG.md @@ -1,3 +1,7 @@ +## [0.3.1] - 2017-05-01 + +* Change to README.md + ## [0.3.0] - 2017-04-27 * Add `canLaunch` method. diff --git a/packages/url-launcher/README.md b/packages/url-launcher/README.md index 514febaaaaaa..dac53c986836 100644 --- a/packages/url-launcher/README.md +++ b/packages/url-launcher/README.md @@ -15,17 +15,21 @@ 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 { + String url = 'http,,tter.io'; + if (await canLaunch(url)) { + launch(url); + } else { + throw "Could not launch $url"; + } } - ``` ## Supported URL schemes From 9d2b3924e584c794d0e055ec90b2ab0d21d72c4f Mon Sep 17 00:00:00 2001 From: Sarah Zakarias Date: Mon, 1 May 2017 09:47:23 +0200 Subject: [PATCH 2/3] fix url --- packages/url-launcher/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/url-launcher/README.md b/packages/url-launcher/README.md index dac53c986836..f3119a757a79 100644 --- a/packages/url-launcher/README.md +++ b/packages/url-launcher/README.md @@ -23,13 +23,14 @@ void main() { } _launchURL() async { - String url = 'http,,tter.io'; + String url = 'https://flutter.io'; if (await canLaunch(url)) { launch(url); } else { throw "Could not launch $url"; } } + ``` ## Supported URL schemes From 61bda80b35e37db6b9b979fec162d611f37420a8 Mon Sep 17 00:00:00 2001 From: Sarah Zakarias Date: Mon, 1 May 2017 10:13:58 +0200 Subject: [PATCH 3/3] comments --- packages/url-launcher/README.md | 6 +++--- packages/url-launcher/example/lib/main.dart | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/url-launcher/README.md b/packages/url-launcher/README.md index f3119a757a79..de0411d1eba0 100644 --- a/packages/url-launcher/README.md +++ b/packages/url-launcher/README.md @@ -23,11 +23,11 @@ void main() { } _launchURL() async { - String url = 'https://flutter.io'; + const url = 'https://flutter.io'; if (await canLaunch(url)) { - launch(url); + await launch(url); } else { - throw "Could not launch $url"; + throw 'Could not launch $url'; } } diff --git a/packages/url-launcher/example/lib/main.dart b/packages/url-launcher/example/lib/main.dart index c98b7fd6bb7a..338178a3a7f8 100644 --- a/packages/url-launcher/example/lib/main.dart +++ b/packages/url-launcher/example/lib/main.dart @@ -45,7 +45,7 @@ class _MyHomePageState extends State { if (await canLaunch(url)) { await launch(url); } else { - throw "Could not launch $url"; + throw 'Could not launch $url'; } } @@ -72,11 +72,11 @@ class _MyHomePageState extends State { 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'), ), ], ),