This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 1+ ## 4.2.0+2
2+
3+ * Updated ` launch ` to use async and await, fixed the incorrect return value by ` launch ` method.
4+
15## 4.2.0+1
26
37* Refactored the Java and Objective-C code. Replaced instance variables with properties in Objective-C.
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ Future<bool> launch(
5959 bool enableJavaScript,
6060 bool universalLinksOnly,
6161 Brightness statusBarBrightness,
62- }) {
62+ }) async {
6363 assert (urlString != null );
6464 final Uri url = Uri .parse (urlString.trimLeft ());
6565 final bool isWebURL = url.scheme == 'http' || url.scheme == 'https' ;
@@ -82,7 +82,7 @@ Future<bool> launch(
8282 // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter.
8383 // https://github.com/flutter/flutter/issues/26431
8484 // ignore: strong_mode_implicit_dynamic_method
85- return _channel.invokeMethod (
85+ final bool result = await _channel.invokeMethod (
8686 'launch' ,
8787 < String , Object > {
8888 'url' : urlString,
@@ -91,12 +91,12 @@ Future<bool> launch(
9191 'enableJavaScript' : enableJavaScript ?? false ,
9292 'universalLinksOnly' : universalLinksOnly ?? false ,
9393 },
94- ). then (( void _) {
95- if (statusBarBrightness != null ) {
96- WidgetsBinding .instance.renderView.automaticSystemUiAdjustment =
97- previousAutomaticSystemUiAdjustment;
98- }
99- }) ;
94+ );
95+ if (statusBarBrightness != null ) {
96+ WidgetsBinding .instance.renderView.automaticSystemUiAdjustment =
97+ previousAutomaticSystemUiAdjustment;
98+ }
99+ return result ;
100100}
101101
102102/// Checks whether the specified URL can be handled by some app installed on the
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ description: Flutter plugin for launching a URL on Android and iOS. Supports
33 web, phone, SMS, and email schemes.
44author : Flutter Team <flutter-dev@googlegroups.com>
55homepage : https://github.com/flutter/plugins/tree/master/packages/url_launcher
6- version : 4.2.0+1
6+ version : 4.2.0+2
77
88flutter :
99 plugin :
You can’t perform that action at this time.
0 commit comments