Skip to content

Commit 4a987d6

Browse files
stuartmorgan-gadsonpleal
authored andcommitted
[url_launcher] Bump platform interface package to stable NNBD (flutter#3570)
Also enables null safety for the unit tests, which had been opted out.
1 parent 2b55117 commit 4a987d6

File tree

4 files changed

+14
-21
lines changed

4 files changed

+14
-21
lines changed

packages/url_launcher/url_launcher_platform_interface/CHANGELOG.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
## 2.0.0-nullsafety.1
2-
3-
* Bump Dart SDK to support null safety.
4-
5-
## 2.0.0-nullsafety
1+
## 2.0.0
62

73
* Migrate to null safety.
84

packages/url_launcher/url_launcher_platform_interface/pubspec.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ description: A common platform interface for the url_launcher plugin.
33
homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher_platform_interface
44
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
55
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
6-
version: 2.0.0-nullsafety.1
6+
version: 2.0.0
77

88
dependencies:
99
flutter:
1010
sdk: flutter
11-
plugin_platform_interface: ^1.1.0-nullsafety.1
11+
plugin_platform_interface: ">=1.0.0 <3.0.0"
1212

1313
dev_dependencies:
1414
flutter_test:
1515
sdk: flutter
16-
mockito: ^4.1.1
17-
pedantic: ^1.10.0-nullsafety.1
16+
mockito: ^5.0.0-nullsafety.7
17+
pedantic: ^1.10.0
1818

1919
environment:
20-
sdk: ">=2.12.0-0 <3.0.0"
20+
sdk: ">=2.12.0-2.12.0-259.9.beta <3.0.0"
2121
flutter: ">=1.22.0"

packages/url_launcher/url_launcher_platform_interface/test/link_test.dart

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// TODO(egarciad): Remove once Mockito has been migrated to null safety.
6-
// @dart = 2.9
7-
85
import 'dart:ui';
96

107
import 'package:mockito/mockito.dart';
@@ -19,18 +16,20 @@ final MethodCodec _codec = const JSONMethodCodec();
1916
void main() {
2017
TestWidgetsFlutterBinding.ensureInitialized();
2118

22-
PlatformMessageCallback oldHandler;
23-
MethodCall lastCall;
19+
PlatformMessageCallback? oldHandler;
20+
MethodCall? lastCall;
2421

2522
setUp(() {
2623
oldHandler = window.onPlatformMessage;
2724
window.onPlatformMessage = (
2825
String name,
29-
ByteData data,
30-
PlatformMessageResponseCallback callback,
26+
ByteData? data,
27+
PlatformMessageResponseCallback? callback,
3128
) {
3229
lastCall = _codec.decodeMethodCall(data);
33-
callback(_codec.encodeSuccessEnvelope(true));
30+
if (callback != null) {
31+
callback(_codec.encodeSuccessEnvelope(true));
32+
}
3433
};
3534
});
3635

packages/url_launcher/url_launcher_platform_interface/test/method_channel_url_launcher_test.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// TODO(mvanbeusekom): Remove once Mockito is migrated to null safety.
6-
// @dart = 2.9
75
import 'package:mockito/mockito.dart';
86
import 'package:flutter/services.dart';
97
import 'package:flutter_test/flutter_test.dart';
@@ -315,5 +313,5 @@ class ImplementsUrlLauncherPlatform extends Mock
315313

316314
class ExtendsUrlLauncherPlatform extends UrlLauncherPlatform {
317315
@override
318-
final LinkDelegate linkDelegate = null;
316+
final LinkDelegate? linkDelegate = null;
319317
}

0 commit comments

Comments
 (0)