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

Commit 736995c

Browse files
committed
Implement PR Feedback
1 parent e76b994 commit 736995c

File tree

19 files changed

+44
-567
lines changed

19 files changed

+44
-567
lines changed

packages/url_launcher/url_launcher_android/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## 6.0.15
22

3-
* Moved away from shared method channel implementation.
3+
* Switches to an in-package method channel implementation.
44

55
## 6.0.14
66

packages/url_launcher/url_launcher_android/lib/url_launcher_android.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import 'package:url_launcher_platform_interface/url_launcher_platform_interface.
1111
const MethodChannel _channel =
1212
MethodChannel('plugins.flutter.io/url_launcher_android');
1313

14-
/// An implementation of [UrlLauncherPlatform] that uses method channels.
14+
/// An implementation of [UrlLauncherPlatform] for Android.
1515
class UrlLauncherAndroid extends UrlLauncherPlatform {
1616
/// Registers this class as the default instance of [UrlLauncherPlatform].
1717
static void registerWith() {
@@ -49,7 +49,6 @@ class UrlLauncherAndroid extends UrlLauncherPlatform {
4949
'launch',
5050
<String, Object>{
5151
'url': url,
52-
'useSafariVC': useSafariVC,
5352
'useWebView': useWebView,
5453
'enableJavaScript': enableJavaScript,
5554
'enableDomStorage': enableDomStorage,

packages/url_launcher/url_launcher_android/test/url_launcher_android_test.dart

Lines changed: 6 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import 'package:flutter/services.dart';
66
import 'package:flutter_test/flutter_test.dart';
77
import 'package:url_launcher_android/url_launcher_android.dart';
8+
import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart';
89

910
void main() {
1011
TestWidgetsFlutterBinding.ensureInitialized();
@@ -27,6 +28,11 @@ void main() {
2728
log.clear();
2829
});
2930

31+
test('registers instance', () {
32+
UrlLauncherAndroid.registerWith();
33+
expect(UrlLauncherPlatform.instance, isA<UrlLauncherAndroid>());
34+
});
35+
3036
test('canLaunch', () async {
3137
await launcher.canLaunch('http://example.com/');
3238
expect(
@@ -60,7 +66,6 @@ void main() {
6066
<Matcher>[
6167
isMethodCall('launch', arguments: <String, Object>{
6268
'url': 'http://example.com/',
63-
'useSafariVC': true,
6469
'useWebView': false,
6570
'enableJavaScript': false,
6671
'enableDomStorage': false,
@@ -86,7 +91,6 @@ void main() {
8691
<Matcher>[
8792
isMethodCall('launch', arguments: <String, Object>{
8893
'url': 'http://example.com/',
89-
'useSafariVC': true,
9094
'useWebView': false,
9195
'enableJavaScript': false,
9296
'enableDomStorage': false,
@@ -97,32 +101,6 @@ void main() {
97101
);
98102
});
99103

100-
test('launch force SafariVC', () async {
101-
await launcher.launch(
102-
'http://example.com/',
103-
useSafariVC: true,
104-
useWebView: false,
105-
enableJavaScript: false,
106-
enableDomStorage: false,
107-
universalLinksOnly: false,
108-
headers: const <String, String>{},
109-
);
110-
expect(
111-
log,
112-
<Matcher>[
113-
isMethodCall('launch', arguments: <String, Object>{
114-
'url': 'http://example.com/',
115-
'useSafariVC': true,
116-
'useWebView': false,
117-
'enableJavaScript': false,
118-
'enableDomStorage': false,
119-
'universalLinksOnly': false,
120-
'headers': <String, String>{},
121-
})
122-
],
123-
);
124-
});
125-
126104
test('launch universal links only', () async {
127105
await launcher.launch(
128106
'http://example.com/',
@@ -138,7 +116,6 @@ void main() {
138116
<Matcher>[
139117
isMethodCall('launch', arguments: <String, Object>{
140118
'url': 'http://example.com/',
141-
'useSafariVC': false,
142119
'useWebView': false,
143120
'enableJavaScript': false,
144121
'enableDomStorage': false,
@@ -164,7 +141,6 @@ void main() {
164141
<Matcher>[
165142
isMethodCall('launch', arguments: <String, Object>{
166143
'url': 'http://example.com/',
167-
'useSafariVC': true,
168144
'useWebView': true,
169145
'enableJavaScript': false,
170146
'enableDomStorage': false,
@@ -190,7 +166,6 @@ void main() {
190166
<Matcher>[
191167
isMethodCall('launch', arguments: <String, Object>{
192168
'url': 'http://example.com/',
193-
'useSafariVC': true,
194169
'useWebView': true,
195170
'enableJavaScript': true,
196171
'enableDomStorage': false,
@@ -216,7 +191,6 @@ void main() {
216191
<Matcher>[
217192
isMethodCall('launch', arguments: <String, Object>{
218193
'url': 'http://example.com/',
219-
'useSafariVC': true,
220194
'useWebView': true,
221195
'enableJavaScript': false,
222196
'enableDomStorage': true,
@@ -227,32 +201,6 @@ void main() {
227201
);
228202
});
229203

230-
test('launch force SafariVC to false', () async {
231-
await launcher.launch(
232-
'http://example.com/',
233-
useSafariVC: false,
234-
useWebView: false,
235-
enableJavaScript: false,
236-
enableDomStorage: false,
237-
universalLinksOnly: false,
238-
headers: const <String, String>{},
239-
);
240-
expect(
241-
log,
242-
<Matcher>[
243-
isMethodCall('launch', arguments: <String, Object>{
244-
'url': 'http://example.com/',
245-
'useSafariVC': false,
246-
'useWebView': false,
247-
'enableJavaScript': false,
248-
'enableDomStorage': false,
249-
'universalLinksOnly': false,
250-
'headers': <String, String>{},
251-
})
252-
],
253-
);
254-
});
255-
256204
test('launch should return false if platform returns null', () async {
257205
final bool launched = await launcher.launch(
258206
'http://example.com/',

packages/url_launcher/url_launcher_ios/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## 6.0.15
22

3-
* Moved away from shared method channel implementation.
3+
* Switches to an in-package method channel implementation.
44

55
## 6.0.14
66

packages/url_launcher/url_launcher_ios/lib/url_launcher_ios.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import 'package:url_launcher_platform_interface/url_launcher_platform_interface.
1111
const MethodChannel _channel =
1212
MethodChannel('plugins.flutter.io/url_launcher_ios');
1313

14-
/// An implementation of [UrlLauncherPlatform] that uses method channels.
14+
/// An implementation of [UrlLauncherPlatform] for iOS.
1515
class UrlLauncherIOS extends UrlLauncherPlatform {
1616
/// Registers this class as the default instance of [UrlLauncherPlatform].
1717
static void registerWith() {
@@ -50,7 +50,6 @@ class UrlLauncherIOS extends UrlLauncherPlatform {
5050
<String, Object>{
5151
'url': url,
5252
'useSafariVC': useSafariVC,
53-
'useWebView': useWebView,
5453
'enableJavaScript': enableJavaScript,
5554
'enableDomStorage': enableDomStorage,
5655
'universalLinksOnly': universalLinksOnly,

packages/url_launcher/url_launcher_ios/test/url_launcher_ios_test.dart

Lines changed: 6 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import 'package:flutter/services.dart';
66
import 'package:flutter_test/flutter_test.dart';
77
import 'package:url_launcher_ios/url_launcher_ios.dart';
8+
import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart';
89

910
void main() {
1011
TestWidgetsFlutterBinding.ensureInitialized();
@@ -27,6 +28,11 @@ void main() {
2728
log.clear();
2829
});
2930

31+
test('registers instance', () {
32+
UrlLauncherIOS.registerWith();
33+
expect(UrlLauncherPlatform.instance, isA<UrlLauncherIOS>());
34+
});
35+
3036
test('canLaunch', () async {
3137
await launcher.canLaunch('http://example.com/');
3238
expect(
@@ -61,7 +67,6 @@ void main() {
6167
isMethodCall('launch', arguments: <String, Object>{
6268
'url': 'http://example.com/',
6369
'useSafariVC': true,
64-
'useWebView': false,
6570
'enableJavaScript': false,
6671
'enableDomStorage': false,
6772
'universalLinksOnly': false,
@@ -87,7 +92,6 @@ void main() {
8792
isMethodCall('launch', arguments: <String, Object>{
8893
'url': 'http://example.com/',
8994
'useSafariVC': true,
90-
'useWebView': false,
9195
'enableJavaScript': false,
9296
'enableDomStorage': false,
9397
'universalLinksOnly': false,
@@ -113,7 +117,6 @@ void main() {
113117
isMethodCall('launch', arguments: <String, Object>{
114118
'url': 'http://example.com/',
115119
'useSafariVC': true,
116-
'useWebView': false,
117120
'enableJavaScript': false,
118121
'enableDomStorage': false,
119122
'universalLinksOnly': false,
@@ -139,7 +142,6 @@ void main() {
139142
isMethodCall('launch', arguments: <String, Object>{
140143
'url': 'http://example.com/',
141144
'useSafariVC': false,
142-
'useWebView': false,
143145
'enableJavaScript': false,
144146
'enableDomStorage': false,
145147
'universalLinksOnly': true,
@@ -149,84 +151,6 @@ void main() {
149151
);
150152
});
151153

152-
test('launch force WebView', () async {
153-
await launcher.launch(
154-
'http://example.com/',
155-
useSafariVC: true,
156-
useWebView: true,
157-
enableJavaScript: false,
158-
enableDomStorage: false,
159-
universalLinksOnly: false,
160-
headers: const <String, String>{},
161-
);
162-
expect(
163-
log,
164-
<Matcher>[
165-
isMethodCall('launch', arguments: <String, Object>{
166-
'url': 'http://example.com/',
167-
'useSafariVC': true,
168-
'useWebView': true,
169-
'enableJavaScript': false,
170-
'enableDomStorage': false,
171-
'universalLinksOnly': false,
172-
'headers': <String, String>{},
173-
})
174-
],
175-
);
176-
});
177-
178-
test('launch force WebView enable javascript', () async {
179-
await launcher.launch(
180-
'http://example.com/',
181-
useSafariVC: true,
182-
useWebView: true,
183-
enableJavaScript: true,
184-
enableDomStorage: false,
185-
universalLinksOnly: false,
186-
headers: const <String, String>{},
187-
);
188-
expect(
189-
log,
190-
<Matcher>[
191-
isMethodCall('launch', arguments: <String, Object>{
192-
'url': 'http://example.com/',
193-
'useSafariVC': true,
194-
'useWebView': true,
195-
'enableJavaScript': true,
196-
'enableDomStorage': false,
197-
'universalLinksOnly': false,
198-
'headers': <String, String>{},
199-
})
200-
],
201-
);
202-
});
203-
204-
test('launch force WebView enable DOM storage', () async {
205-
await launcher.launch(
206-
'http://example.com/',
207-
useSafariVC: true,
208-
useWebView: true,
209-
enableJavaScript: false,
210-
enableDomStorage: true,
211-
universalLinksOnly: false,
212-
headers: const <String, String>{},
213-
);
214-
expect(
215-
log,
216-
<Matcher>[
217-
isMethodCall('launch', arguments: <String, Object>{
218-
'url': 'http://example.com/',
219-
'useSafariVC': true,
220-
'useWebView': true,
221-
'enableJavaScript': false,
222-
'enableDomStorage': true,
223-
'universalLinksOnly': false,
224-
'headers': <String, String>{},
225-
})
226-
],
227-
);
228-
});
229-
230154
test('launch force SafariVC to false', () async {
231155
await launcher.launch(
232156
'http://example.com/',
@@ -243,7 +167,6 @@ void main() {
243167
isMethodCall('launch', arguments: <String, Object>{
244168
'url': 'http://example.com/',
245169
'useSafariVC': false,
246-
'useWebView': false,
247170
'enableJavaScript': false,
248171
'enableDomStorage': false,
249172
'universalLinksOnly': false,

packages/url_launcher/url_launcher_linux/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## 2.0.4
22

3-
* Moved away from shared method channel implementation.
3+
* Switches to an in-package method channel implementation.
44

55
## 2.0.3
66

packages/url_launcher/url_launcher_linux/lib/url_launcher_linux.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import 'package:url_launcher_platform_interface/url_launcher_platform_interface.
1111
const MethodChannel _channel =
1212
MethodChannel('plugins.flutter.io/url_launcher_linux');
1313

14-
/// An implementation of [UrlLauncherPlatform] that uses method channels.
14+
/// An implementation of [UrlLauncherPlatform] for Linux.
1515
class UrlLauncherLinux extends UrlLauncherPlatform {
1616
/// Registers this class as the default instance of [UrlLauncherPlatform].
1717
static void registerWith() {
@@ -44,8 +44,6 @@ class UrlLauncherLinux extends UrlLauncherPlatform {
4444
'launch',
4545
<String, Object>{
4646
'url': url,
47-
'useSafariVC': useSafariVC,
48-
'useWebView': useWebView,
4947
'enableJavaScript': enableJavaScript,
5048
'enableDomStorage': enableDomStorage,
5149
'universalLinksOnly': universalLinksOnly,

0 commit comments

Comments
 (0)