Skip to content

Commit 7365b61

Browse files
authored
[url_launcher] Remove deprecated onPlatformMessage calls (#4233)
The framework has been fully migrated to ChannelBuffers about 2 years ago, meaning all Flutter versions supported by this package (>=3.3.0) only use ChannelBuffers and not the old `onPlatformMessage` call. Therefore, the old calls can now just be removed. (This surfaced because we only remembered just now to deprecate the old long unused API.)
1 parent ed739ac commit 7365b61

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

packages/url_launcher/url_launcher_platform_interface/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
## NEXT
1+
## 2.1.3
22

33
* Updates minimum Flutter version to 3.3.
44
* Aligns Dart and Flutter SDK constraints.
5+
* Removes deprecated API calls.
56

67
## 2.1.2
78

packages/url_launcher/url_launcher_platform_interface/lib/link.dart

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ abstract class LinkInfo {
7474
bool get isDisabled;
7575
}
7676

77-
typedef _SendMessage = Function(String, ByteData?, void Function(ByteData?));
78-
7977
/// Pushes the [routeName] into Flutter's navigation system via a platform
8078
/// message.
8179
///
@@ -91,11 +89,7 @@ Future<ByteData> pushRouteNameToFramework(Object? _, String routeName) {
9189
// https://github.com/flutter/flutter/issues/124045.
9290
// ignore: deprecated_member_use
9391
SystemNavigator.routeInformationUpdated(location: routeName);
94-
final _SendMessage sendMessage = _ambiguate(WidgetsBinding.instance)
95-
?.platformDispatcher
96-
.onPlatformMessage ??
97-
ui.channelBuffers.push;
98-
sendMessage(
92+
ui.channelBuffers.push(
9993
'flutter/navigation',
10094
_codec.encodeMethodCall(
10195
MethodCall('pushRouteInformation', <dynamic, dynamic>{
@@ -107,9 +101,3 @@ Future<ByteData> pushRouteNameToFramework(Object? _, String routeName) {
107101
);
108102
return completer.future;
109103
}
110-
111-
/// This allows a value of type T or T? to be treated as a value of type T?.
112-
///
113-
/// We use this so that APIs that have become non-nullable can still be used
114-
/// with `!` and `?` on the stable branch.
115-
T? _ambiguate<T>(T? value) => value;

packages/url_launcher/url_launcher_platform_interface/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22
55
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
66
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
7-
version: 2.1.2
7+
version: 2.1.3
88

99
environment:
1010
sdk: ">=2.18.0 <4.0.0"

0 commit comments

Comments
 (0)