Skip to content

[url_launcher] Remove deprecated onPlatformMessage calls #4233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## NEXT
## 2.1.3

* Updates minimum Flutter version to 3.3.
* Aligns Dart and Flutter SDK constraints.
* Removes deprecated API calls.

## 2.1.2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ abstract class LinkInfo {
bool get isDisabled;
}

typedef _SendMessage = Function(String, ByteData?, void Function(ByteData?));

/// Pushes the [routeName] into Flutter's navigation system via a platform
/// message.
///
Expand All @@ -91,11 +89,7 @@ Future<ByteData> pushRouteNameToFramework(Object? _, String routeName) {
// https://github.com/flutter/flutter/issues/124045.
// ignore: deprecated_member_use
SystemNavigator.routeInformationUpdated(location: routeName);
final _SendMessage sendMessage = _ambiguate(WidgetsBinding.instance)
?.platformDispatcher
.onPlatformMessage ??
ui.channelBuffers.push;
sendMessage(
ui.channelBuffers.push(
'flutter/navigation',
_codec.encodeMethodCall(
MethodCall('pushRouteInformation', <dynamic, dynamic>{
Expand All @@ -107,9 +101,3 @@ Future<ByteData> pushRouteNameToFramework(Object? _, String routeName) {
);
return completer.future;
}

/// This allows a value of type T or T? to be treated as a value of type T?.
///
/// We use this so that APIs that have become non-nullable can still be used
/// with `!` and `?` on the stable branch.
T? _ambiguate<T>(T? value) => value;
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 2.1.2
version: 2.1.3

environment:
sdk: ">=2.18.0 <4.0.0"
Expand Down