Skip to content
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

[url_launcher] Update Pigeon version for Linux #8065

Merged
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
4 changes: 4 additions & 0 deletions packages/url_launcher/url_launcher_linux/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.2.1

* Updates Pigeon to resolve a compilation failure with some versions of glib.

## 3.2.0

* Updates platform channels to use Pigeon.
Expand Down
85 changes: 51 additions & 34 deletions packages/url_launcher/url_launcher_linux/lib/src/messages.g.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Autogenerated from Pigeon (v21.1.0), do not edit directly.
// Autogenerated from Pigeon (v22.6.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers

Expand All @@ -20,6 +20,23 @@ PlatformException _createConnectionError(String channelName) {

class _PigeonCodec extends StandardMessageCodec {
const _PigeonCodec();
@override
void writeValue(WriteBuffer buffer, Object? value) {
if (value is int) {
buffer.putUint8(4);
buffer.putInt64(value);
} else {
super.writeValue(buffer, value);
}
}

@override
Object? readValueOfType(int type, ReadBuffer buffer) {
switch (type) {
default:
return super.readValueOfType(type, buffer);
}
}
}

class UrlLauncherApi {
Expand All @@ -28,67 +45,67 @@ class UrlLauncherApi {
/// BinaryMessenger will be used which routes to the host platform.
UrlLauncherApi(
{BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
: __pigeon_binaryMessenger = binaryMessenger,
__pigeon_messageChannelSuffix =
: pigeonVar_binaryMessenger = binaryMessenger,
pigeonVar_messageChannelSuffix =
messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
final BinaryMessenger? __pigeon_binaryMessenger;
final BinaryMessenger? pigeonVar_binaryMessenger;

static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();

final String __pigeon_messageChannelSuffix;
final String pigeonVar_messageChannelSuffix;

/// Returns true if the URL can definitely be launched.
Future<bool> canLaunchUrl(String url) async {
final String __pigeon_channelName =
'dev.flutter.pigeon.url_launcher_linux.UrlLauncherApi.canLaunchUrl$__pigeon_messageChannelSuffix';
final BasicMessageChannel<Object?> __pigeon_channel =
final String pigeonVar_channelName =
'dev.flutter.pigeon.url_launcher_linux.UrlLauncherApi.canLaunchUrl$pigeonVar_messageChannelSuffix';
final BasicMessageChannel<Object?> pigeonVar_channel =
BasicMessageChannel<Object?>(
__pigeon_channelName,
pigeonVar_channelName,
pigeonChannelCodec,
binaryMessenger: __pigeon_binaryMessenger,
binaryMessenger: pigeonVar_binaryMessenger,
);
final List<Object?>? __pigeon_replyList =
await __pigeon_channel.send(<Object?>[url]) as List<Object?>?;
if (__pigeon_replyList == null) {
throw _createConnectionError(__pigeon_channelName);
} else if (__pigeon_replyList.length > 1) {
final List<Object?>? pigeonVar_replyList =
await pigeonVar_channel.send(<Object?>[url]) as List<Object?>?;
if (pigeonVar_replyList == null) {
throw _createConnectionError(pigeonVar_channelName);
} else if (pigeonVar_replyList.length > 1) {
throw PlatformException(
code: __pigeon_replyList[0]! as String,
message: __pigeon_replyList[1] as String?,
details: __pigeon_replyList[2],
code: pigeonVar_replyList[0]! as String,
message: pigeonVar_replyList[1] as String?,
details: pigeonVar_replyList[2],
);
} else if (__pigeon_replyList[0] == null) {
} else if (pigeonVar_replyList[0] == null) {
throw PlatformException(
code: 'null-error',
message: 'Host platform returned null value for non-null return value.',
);
} else {
return (__pigeon_replyList[0] as bool?)!;
return (pigeonVar_replyList[0] as bool?)!;
}
}

/// Opens the URL externally, returning an error string on failure.
Future<String?> launchUrl(String url) async {
final String __pigeon_channelName =
'dev.flutter.pigeon.url_launcher_linux.UrlLauncherApi.launchUrl$__pigeon_messageChannelSuffix';
final BasicMessageChannel<Object?> __pigeon_channel =
final String pigeonVar_channelName =
'dev.flutter.pigeon.url_launcher_linux.UrlLauncherApi.launchUrl$pigeonVar_messageChannelSuffix';
final BasicMessageChannel<Object?> pigeonVar_channel =
BasicMessageChannel<Object?>(
__pigeon_channelName,
pigeonVar_channelName,
pigeonChannelCodec,
binaryMessenger: __pigeon_binaryMessenger,
binaryMessenger: pigeonVar_binaryMessenger,
);
final List<Object?>? __pigeon_replyList =
await __pigeon_channel.send(<Object?>[url]) as List<Object?>?;
if (__pigeon_replyList == null) {
throw _createConnectionError(__pigeon_channelName);
} else if (__pigeon_replyList.length > 1) {
final List<Object?>? pigeonVar_replyList =
await pigeonVar_channel.send(<Object?>[url]) as List<Object?>?;
if (pigeonVar_replyList == null) {
throw _createConnectionError(pigeonVar_channelName);
} else if (pigeonVar_replyList.length > 1) {
throw PlatformException(
code: __pigeon_replyList[0]! as String,
message: __pigeon_replyList[1] as String?,
details: __pigeon_replyList[2],
code: pigeonVar_replyList[0]! as String,
message: pigeonVar_replyList[1] as String?,
details: pigeonVar_replyList[2],
);
} else {
return (__pigeon_replyList[0] as String?);
return (pigeonVar_replyList[0] as String?);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Autogenerated from Pigeon (v21.1.0), do not edit directly.
// Autogenerated from Pigeon (v22.6.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon

#include "messages.g.h"

G_DECLARE_FINAL_TYPE(FulMessageCodec, ful_message_codec, FUL, MESSAGE_CODEC,
FlStandardMessageCodec)

struct _FulMessageCodec {
FlStandardMessageCodec parent_instance;
};
Expand Down Expand Up @@ -159,9 +156,6 @@ ful_url_launcher_api_launch_url_response_new_error(const gchar* code,
return self;
}

G_DECLARE_FINAL_TYPE(FulUrlLauncherApi, ful_url_launcher_api, FUL,
URL_LAUNCHER_API, GObject)

struct _FulUrlLauncherApi {
GObject parent_instance;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Autogenerated from Pigeon (v21.1.0), do not edit directly.
// Autogenerated from Pigeon (v22.6.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon

#ifndef PIGEON_MESSAGES_G_H_
Expand All @@ -11,6 +11,12 @@

G_BEGIN_DECLS

G_DECLARE_FINAL_TYPE(FulMessageCodec, ful_message_codec, FUL, MESSAGE_CODEC,
FlStandardMessageCodec)

G_DECLARE_FINAL_TYPE(FulUrlLauncherApi, ful_url_launcher_api, FUL,
URL_LAUNCHER_API, GObject)

G_DECLARE_FINAL_TYPE(FulUrlLauncherApiCanLaunchUrlResponse,
ful_url_launcher_api_can_launch_url_response, FUL,
URL_LAUNCHER_API_CAN_LAUNCH_URL_RESPONSE, GObject)
Expand Down
4 changes: 2 additions & 2 deletions packages/url_launcher/url_launcher_linux/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: url_launcher_linux
description: Linux implementation of the url_launcher plugin.
repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_linux
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22
version: 3.2.0
version: 3.2.1

environment:
sdk: ^3.3.0
Expand All @@ -24,7 +24,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
pigeon: ^21.1.0
pigeon: ^22.6.1
test: ^1.16.3

topics:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,12 @@ class _FakeUrlLauncherApi implements UrlLauncherApi {
argument = url;
return error;
}

@override
// ignore: non_constant_identifier_names
BinaryMessenger? get pigeonVar_binaryMessenger => null;

@override
// ignore: non_constant_identifier_names
String get pigeonVar_messageChannelSuffix => '';
}