[various] Update Windows packages to Pigeon 21 (#7180)
Updates all Windows platform implementation packages to use the latest version of Pigeon. The main motivation was picking up the enum naming fix, but I figured I'd do all of them at once, even if they didn't use enums.
diff --git a/packages/camera/camera_windows/CHANGELOG.md b/packages/camera/camera_windows/CHANGELOG.md
index 4b16434..47b5420 100644
--- a/packages/camera/camera_windows/CHANGELOG.md
+++ b/packages/camera/camera_windows/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.2.4+1
+
+* Updates to pigeon 21.
+
## 0.2.4
* Removes `maxVideoDuration`/`maxDuration`, as the feature was never exposed at
diff --git a/packages/camera/camera_windows/lib/src/messages.g.dart b/packages/camera/camera_windows/lib/src/messages.g.dart
index a522461..deb0bcb 100644
--- a/packages/camera/camera_windows/lib/src/messages.g.dart
+++ b/packages/camera/camera_windows/lib/src/messages.g.dart
@@ -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 (v20.0.2), do not edit directly.
+// Autogenerated from Pigeon (v21.0.0), 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
diff --git a/packages/camera/camera_windows/pubspec.yaml b/packages/camera/camera_windows/pubspec.yaml
index 7e3f738..703c46b 100644
--- a/packages/camera/camera_windows/pubspec.yaml
+++ b/packages/camera/camera_windows/pubspec.yaml
@@ -2,7 +2,7 @@
description: A Flutter plugin for getting information about and controlling the camera on Windows.
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_windows
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
-version: 0.2.4
+version: 0.2.4+1
environment:
sdk: ^3.2.0
@@ -29,7 +29,7 @@
flutter_test:
sdk: flutter
mockito: 5.4.4
- pigeon: ^20.0.0
+ pigeon: ^21.0.0
topics:
- camera
diff --git a/packages/camera/camera_windows/windows/capture_controller.cpp b/packages/camera/camera_windows/windows/capture_controller.cpp
index de1aa55..25ff723 100644
--- a/packages/camera/camera_windows/windows/capture_controller.cpp
+++ b/packages/camera/camera_windows/windows/capture_controller.cpp
@@ -35,7 +35,7 @@
CaptureControllerListener* listener)
: capture_controller_listener_(listener),
media_settings_(
- PlatformMediaSettings(PlatformResolutionPreset::max, true)),
+ PlatformMediaSettings(PlatformResolutionPreset::kMax, true)),
CaptureController(){};
CaptureControllerImpl::~CaptureControllerImpl() {
@@ -381,17 +381,17 @@
uint32_t CaptureControllerImpl::GetMaxPreviewHeight() const {
switch (media_settings_.resolution_preset()) {
- case PlatformResolutionPreset::low:
+ case PlatformResolutionPreset::kLow:
return 240;
- case PlatformResolutionPreset::medium:
+ case PlatformResolutionPreset::kMedium:
return 480;
- case PlatformResolutionPreset::high:
+ case PlatformResolutionPreset::kHigh:
return 720;
- case PlatformResolutionPreset::veryHigh:
+ case PlatformResolutionPreset::kVeryHigh:
return 1080;
- case PlatformResolutionPreset::ultraHigh:
+ case PlatformResolutionPreset::kUltraHigh:
return 2160;
- case PlatformResolutionPreset::max:
+ case PlatformResolutionPreset::kMax:
default:
// no limit.
return 0xffffffff;
diff --git a/packages/camera/camera_windows/windows/messages.g.cpp b/packages/camera/camera_windows/windows/messages.g.cpp
index bf8020b..c810587 100644
--- a/packages/camera/camera_windows/windows/messages.g.cpp
+++ b/packages/camera/camera_windows/windows/messages.g.cpp
@@ -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 (v20.0.2), do not edit directly.
+// Autogenerated from Pigeon (v21.0.0), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#undef _HAS_EXCEPTIONS
diff --git a/packages/camera/camera_windows/windows/messages.g.h b/packages/camera/camera_windows/windows/messages.g.h
index c20b1bd..0397cd8 100644
--- a/packages/camera/camera_windows/windows/messages.g.h
+++ b/packages/camera/camera_windows/windows/messages.g.h
@@ -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 (v20.0.2), do not edit directly.
+// Autogenerated from Pigeon (v21.0.0), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#ifndef PIGEON_MESSAGES_G_H_
@@ -60,12 +60,12 @@
// Pigeon version of platform interface's ResolutionPreset.
enum class PlatformResolutionPreset {
- low = 0,
- medium = 1,
- high = 2,
- veryHigh = 3,
- ultraHigh = 4,
- max = 5
+ kLow = 0,
+ kMedium = 1,
+ kHigh = 2,
+ kVeryHigh = 3,
+ kUltraHigh = 4,
+ kMax = 5
};
// Pigeon version of MediaSettings.
diff --git a/packages/camera/camera_windows/windows/test/camera_plugin_test.cpp b/packages/camera/camera_windows/windows/test/camera_plugin_test.cpp
index 412c46b..2680ae2 100644
--- a/packages/camera/camera_windows/windows/test/camera_plugin_test.cpp
+++ b/packages/camera/camera_windows/windows/test/camera_plugin_test.cpp
@@ -142,7 +142,7 @@
};
plugin.Create(MOCK_CAMERA_NAME,
- PlatformMediaSettings(PlatformResolutionPreset::max, true),
+ PlatformMediaSettings(PlatformResolutionPreset::kMax, true),
std::move(create_result));
EXPECT_TRUE(result_called);
@@ -168,7 +168,7 @@
};
plugin.Create(MOCK_INVALID_CAMERA_NAME,
- PlatformMediaSettings(PlatformResolutionPreset::max, true),
+ PlatformMediaSettings(PlatformResolutionPreset::kMax, true),
std::move(create_result));
EXPECT_TRUE(result_called);
@@ -204,7 +204,7 @@
EXPECT_EQ(reply.value(), 1);
};
- PlatformMediaSettings media_settings(PlatformResolutionPreset::max, true);
+ PlatformMediaSettings media_settings(PlatformResolutionPreset::kMax, true);
plugin.Create(MOCK_CAMERA_NAME, media_settings,
std::move(first_create_result));
@@ -263,7 +263,7 @@
EXPECT_TRUE(reply.has_error());
};
- PlatformMediaSettings media_settings(PlatformResolutionPreset::max, true);
+ PlatformMediaSettings media_settings(PlatformResolutionPreset::kMax, true);
plugin.Create(MOCK_CAMERA_NAME, media_settings,
std::move(first_create_result));
diff --git a/packages/camera/camera_windows/windows/test/camera_test.cpp b/packages/camera/camera_windows/windows/test/camera_test.cpp
index c5b5a5c..3aa1993 100644
--- a/packages/camera/camera_windows/windows/test/camera_test.cpp
+++ b/packages/camera/camera_windows/windows/test/camera_test.cpp
@@ -49,7 +49,7 @@
EXPECT_TRUE(camera->GetCaptureController() == nullptr);
- PlatformMediaSettings media_settings(PlatformResolutionPreset::max, false);
+ PlatformMediaSettings media_settings(PlatformResolutionPreset::kMax, false);
// Init camera with mock capture controller factory
bool result = camera->InitCamera(
@@ -81,7 +81,7 @@
EXPECT_TRUE(camera->GetCaptureController() == nullptr);
- PlatformMediaSettings media_settings(PlatformResolutionPreset::max, false);
+ PlatformMediaSettings media_settings(PlatformResolutionPreset::kMax, false);
// Init camera with mock capture controller factory
bool result = camera->InitCamera(
diff --git a/packages/camera/camera_windows/windows/test/capture_controller_test.cpp b/packages/camera/camera_windows/windows/test/capture_controller_test.cpp
index 3d0087b..aa0b546 100644
--- a/packages/camera/camera_windows/windows/test/capture_controller_test.cpp
+++ b/packages/camera/camera_windows/windows/test/capture_controller_test.cpp
@@ -34,7 +34,7 @@
MockTextureRegistrar* texture_registrar, MockCaptureEngine* engine,
MockCamera* camera, int64_t mock_texture_id,
const PlatformMediaSettings media_settings =
- PlatformMediaSettings(PlatformResolutionPreset::max, true)) {
+ PlatformMediaSettings(PlatformResolutionPreset::kMax, true)) {
ComPtr<MockMediaSource> video_source = new MockMediaSource();
ComPtr<MockMediaSource> audio_source = new MockMediaSource();
@@ -261,7 +261,7 @@
bool result = capture_controller->InitCaptureDevice(
texture_registrar.get(), MOCK_DEVICE_ID,
- PlatformMediaSettings(PlatformResolutionPreset::max, true));
+ PlatformMediaSettings(PlatformResolutionPreset::kMax, true));
EXPECT_FALSE(result);
@@ -303,7 +303,7 @@
bool result = capture_controller->InitCaptureDevice(
texture_registrar.get(), MOCK_DEVICE_ID,
- PlatformMediaSettings(PlatformResolutionPreset::max, true));
+ PlatformMediaSettings(PlatformResolutionPreset::kMax, true));
EXPECT_FALSE(result);
EXPECT_FALSE(engine->initialized_);
@@ -348,7 +348,7 @@
bool result = capture_controller->InitCaptureDevice(
texture_registrar.get(), MOCK_DEVICE_ID,
- PlatformMediaSettings(PlatformResolutionPreset::max, true));
+ PlatformMediaSettings(PlatformResolutionPreset::kMax, true));
EXPECT_FALSE(result);
EXPECT_FALSE(engine->initialized_);
@@ -734,7 +734,7 @@
const auto kVideoBitrate = 200000;
const auto kAudioBitrate = 32000;
- PlatformMediaSettings media_settings(PlatformResolutionPreset::max, true);
+ PlatformMediaSettings media_settings(PlatformResolutionPreset::kMax, true);
media_settings.set_frames_per_second(kFps);
media_settings.set_video_bitrate(kVideoBitrate);
media_settings.set_audio_bitrate(kAudioBitrate);
diff --git a/packages/file_selector/file_selector_windows/CHANGELOG.md b/packages/file_selector/file_selector_windows/CHANGELOG.md
index 7d50124..d6e5287 100644
--- a/packages/file_selector/file_selector_windows/CHANGELOG.md
+++ b/packages/file_selector/file_selector_windows/CHANGELOG.md
@@ -1,5 +1,6 @@
-## NEXT
+## 0.9.3+2
+* Updates to pigeon 21.
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
## 0.9.3+1
diff --git a/packages/file_selector/file_selector_windows/lib/file_selector_windows.dart b/packages/file_selector/file_selector_windows/lib/file_selector_windows.dart
index b96886b..96f53b6 100644
--- a/packages/file_selector/file_selector_windows/lib/file_selector_windows.dart
+++ b/packages/file_selector/file_selector_windows/lib/file_selector_windows.dart
@@ -23,8 +23,6 @@
}) async {
final FileDialogResult result = await _hostApi.showOpenDialog(
SelectionOptions(
- allowMultiple: false,
- selectFolders: false,
allowedTypes: _typeGroupsFromXTypeGroups(acceptedTypeGroups),
),
initialDirectory,
@@ -41,7 +39,6 @@
final FileDialogResult result = await _hostApi.showOpenDialog(
SelectionOptions(
allowMultiple: true,
- selectFolders: false,
allowedTypes: _typeGroupsFromXTypeGroups(acceptedTypeGroups),
),
initialDirectory,
@@ -73,8 +70,6 @@
}) async {
final FileDialogResult result = await _hostApi.showSaveDialog(
SelectionOptions(
- allowMultiple: false,
- selectFolders: false,
allowedTypes: _typeGroupsFromXTypeGroups(acceptedTypeGroups),
),
options.initialDirectory,
@@ -95,7 +90,6 @@
}) async {
final FileDialogResult result = await _hostApi.showOpenDialog(
SelectionOptions(
- allowMultiple: false,
selectFolders: true,
allowedTypes: <TypeGroup>[],
),
diff --git a/packages/file_selector/file_selector_windows/lib/src/messages.g.dart b/packages/file_selector/file_selector_windows/lib/src/messages.g.dart
index b5b4a79..12f57b1 100644
--- a/packages/file_selector/file_selector_windows/lib/src/messages.g.dart
+++ b/packages/file_selector/file_selector_windows/lib/src/messages.g.dart
@@ -1,9 +1,9 @@
// 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 (v10.0.1), do not edit directly.
+// Autogenerated from Pigeon (v21.0.0), 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
+// 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
import 'dart:async';
import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List;
@@ -11,6 +11,24 @@
import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer;
import 'package:flutter/services.dart';
+PlatformException _createConnectionError(String channelName) {
+ return PlatformException(
+ code: 'channel-error',
+ message: 'Unable to establish connection on channel: "$channelName".',
+ );
+}
+
+List<Object?> wrapResponse(
+ {Object? result, PlatformException? error, bool empty = false}) {
+ if (empty) {
+ return <Object?>[];
+ }
+ if (error == null) {
+ return <Object?>[result];
+ }
+ return <Object?>[error.code, error.message, error.details];
+}
+
class TypeGroup {
TypeGroup({
required this.label,
@@ -39,9 +57,9 @@
class SelectionOptions {
SelectionOptions({
- required this.allowMultiple,
- required this.selectFolders,
- required this.allowedTypes,
+ this.allowMultiple = false,
+ this.selectFolders = false,
+ this.allowedTypes = const <TypeGroup?>[],
});
bool allowMultiple;
@@ -102,19 +120,19 @@
}
}
-class _FileSelectorApiCodec extends StandardMessageCodec {
- const _FileSelectorApiCodec();
+class _PigeonCodec extends StandardMessageCodec {
+ const _PigeonCodec();
@override
void writeValue(WriteBuffer buffer, Object? value) {
- if (value is FileDialogResult) {
- buffer.putUint8(128);
- writeValue(buffer, value.encode());
- } else if (value is SelectionOptions) {
+ if (value is TypeGroup) {
buffer.putUint8(129);
writeValue(buffer, value.encode());
- } else if (value is TypeGroup) {
+ } else if (value is SelectionOptions) {
buffer.putUint8(130);
writeValue(buffer, value.encode());
+ } else if (value is FileDialogResult) {
+ buffer.putUint8(131);
+ writeValue(buffer, value.encode());
} else {
super.writeValue(buffer, value);
}
@@ -123,12 +141,12 @@
@override
Object? readValueOfType(int type, ReadBuffer buffer) {
switch (type) {
- case 128:
- return FileDialogResult.decode(readValue(buffer)!);
case 129:
- return SelectionOptions.decode(readValue(buffer)!);
- case 130:
return TypeGroup.decode(readValue(buffer)!);
+ case 130:
+ return SelectionOptions.decode(readValue(buffer)!);
+ case 131:
+ return FileDialogResult.decode(readValue(buffer)!);
default:
return super.readValueOfType(type, buffer);
}
@@ -139,73 +157,83 @@
/// Constructor for [FileSelectorApi]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default
/// BinaryMessenger will be used which routes to the host platform.
- FileSelectorApi({BinaryMessenger? binaryMessenger})
- : _binaryMessenger = binaryMessenger;
- final BinaryMessenger? _binaryMessenger;
+ FileSelectorApi(
+ {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
+ : __pigeon_binaryMessenger = binaryMessenger,
+ __pigeon_messageChannelSuffix =
+ messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
+ final BinaryMessenger? __pigeon_binaryMessenger;
- static const MessageCodec<Object?> codec = _FileSelectorApiCodec();
+ static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
- Future<FileDialogResult> showOpenDialog(SelectionOptions arg_options,
- String? arg_initialDirectory, String? arg_confirmButtonText) async {
- final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
- 'dev.flutter.pigeon.FileSelectorApi.showOpenDialog', codec,
- binaryMessenger: _binaryMessenger);
- final List<Object?>? replyList = await channel.send(
- <Object?>[arg_options, arg_initialDirectory, arg_confirmButtonText])
+ final String __pigeon_messageChannelSuffix;
+
+ Future<FileDialogResult> showOpenDialog(SelectionOptions options,
+ String? initialDirectory, String? confirmButtonText) async {
+ final String __pigeon_channelName =
+ 'dev.flutter.pigeon.file_selector_windows.FileSelectorApi.showOpenDialog$__pigeon_messageChannelSuffix';
+ final BasicMessageChannel<Object?> __pigeon_channel =
+ BasicMessageChannel<Object?>(
+ __pigeon_channelName,
+ pigeonChannelCodec,
+ binaryMessenger: __pigeon_binaryMessenger,
+ );
+ final List<Object?>? __pigeon_replyList = await __pigeon_channel
+ .send(<Object?>[options, initialDirectory, confirmButtonText])
as List<Object?>?;
- if (replyList == null) {
+ if (__pigeon_replyList == null) {
+ throw _createConnectionError(__pigeon_channelName);
+ } else if (__pigeon_replyList.length > 1) {
throw PlatformException(
- code: 'channel-error',
- message: 'Unable to establish connection on channel.',
+ code: __pigeon_replyList[0]! as String,
+ message: __pigeon_replyList[1] as String?,
+ details: __pigeon_replyList[2],
);
- } else if (replyList.length > 1) {
- throw PlatformException(
- code: replyList[0]! as String,
- message: replyList[1] as String?,
- details: replyList[2],
- );
- } else if (replyList[0] == null) {
+ } else if (__pigeon_replyList[0] == null) {
throw PlatformException(
code: 'null-error',
message: 'Host platform returned null value for non-null return value.',
);
} else {
- return (replyList[0] as FileDialogResult?)!;
+ return (__pigeon_replyList[0] as FileDialogResult?)!;
}
}
Future<FileDialogResult> showSaveDialog(
- SelectionOptions arg_options,
- String? arg_initialDirectory,
- String? arg_suggestedName,
- String? arg_confirmButtonText) async {
- final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
- 'dev.flutter.pigeon.FileSelectorApi.showSaveDialog', codec,
- binaryMessenger: _binaryMessenger);
- final List<Object?>? replyList = await channel.send(<Object?>[
- arg_options,
- arg_initialDirectory,
- arg_suggestedName,
- arg_confirmButtonText
+ SelectionOptions options,
+ String? initialDirectory,
+ String? suggestedName,
+ String? confirmButtonText) async {
+ final String __pigeon_channelName =
+ 'dev.flutter.pigeon.file_selector_windows.FileSelectorApi.showSaveDialog$__pigeon_messageChannelSuffix';
+ final BasicMessageChannel<Object?> __pigeon_channel =
+ BasicMessageChannel<Object?>(
+ __pigeon_channelName,
+ pigeonChannelCodec,
+ binaryMessenger: __pigeon_binaryMessenger,
+ );
+ final List<Object?>? __pigeon_replyList = await __pigeon_channel
+ .send(<Object?>[
+ options,
+ initialDirectory,
+ suggestedName,
+ confirmButtonText
]) as List<Object?>?;
- if (replyList == null) {
+ if (__pigeon_replyList == null) {
+ throw _createConnectionError(__pigeon_channelName);
+ } else if (__pigeon_replyList.length > 1) {
throw PlatformException(
- code: 'channel-error',
- message: 'Unable to establish connection on channel.',
+ code: __pigeon_replyList[0]! as String,
+ message: __pigeon_replyList[1] as String?,
+ details: __pigeon_replyList[2],
);
- } else if (replyList.length > 1) {
- throw PlatformException(
- code: replyList[0]! as String,
- message: replyList[1] as String?,
- details: replyList[2],
- );
- } else if (replyList[0] == null) {
+ } else if (__pigeon_replyList[0] == null) {
throw PlatformException(
code: 'null-error',
message: 'Host platform returned null value for non-null return value.',
);
} else {
- return (replyList[0] as FileDialogResult?)!;
+ return (__pigeon_replyList[0] as FileDialogResult?)!;
}
}
}
diff --git a/packages/file_selector/file_selector_windows/pubspec.yaml b/packages/file_selector/file_selector_windows/pubspec.yaml
index 93159d8..385c63a 100644
--- a/packages/file_selector/file_selector_windows/pubspec.yaml
+++ b/packages/file_selector/file_selector_windows/pubspec.yaml
@@ -2,7 +2,7 @@
description: Windows implementation of the file_selector plugin.
repository: https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_windows
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22
-version: 0.9.3+1
+version: 0.9.3+2
environment:
sdk: ^3.2.0
@@ -27,7 +27,7 @@
flutter_test:
sdk: flutter
mockito: 5.4.4
- pigeon: ^10.0.0
+ pigeon: ^21.0.0
topics:
- files
diff --git a/packages/file_selector/file_selector_windows/test/file_selector_windows_test.dart b/packages/file_selector/file_selector_windows/test/file_selector_windows_test.dart
index 4f455ee..4d67562 100644
--- a/packages/file_selector/file_selector_windows/test/file_selector_windows_test.dart
+++ b/packages/file_selector/file_selector_windows/test/file_selector_windows_test.dart
@@ -22,7 +22,7 @@
setUp(() {
mockApi = MockTestFileSelectorApi();
- TestFileSelectorApi.setup(mockApi);
+ TestFileSelectorApi.setUp(mockApi);
});
test('registered instance', () {
diff --git a/packages/file_selector/file_selector_windows/test/test_api.g.dart b/packages/file_selector/file_selector_windows/test/test_api.g.dart
index 778ae4f..2f9cabd 100644
--- a/packages/file_selector/file_selector_windows/test/test_api.g.dart
+++ b/packages/file_selector/file_selector_windows/test/test_api.g.dart
@@ -1,9 +1,9 @@
// 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 (v10.0.1), do not edit directly.
+// Autogenerated from Pigeon (v21.0.0), 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, unnecessary_import
+// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import, no_leading_underscores_for_local_identifiers
// ignore_for_file: avoid_relative_lib_imports
import 'dart:async';
import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List;
@@ -13,19 +13,19 @@
import 'package:file_selector_windows/src/messages.g.dart';
-class _TestFileSelectorApiCodec extends StandardMessageCodec {
- const _TestFileSelectorApiCodec();
+class _PigeonCodec extends StandardMessageCodec {
+ const _PigeonCodec();
@override
void writeValue(WriteBuffer buffer, Object? value) {
- if (value is FileDialogResult) {
- buffer.putUint8(128);
- writeValue(buffer, value.encode());
- } else if (value is SelectionOptions) {
+ if (value is TypeGroup) {
buffer.putUint8(129);
writeValue(buffer, value.encode());
- } else if (value is TypeGroup) {
+ } else if (value is SelectionOptions) {
buffer.putUint8(130);
writeValue(buffer, value.encode());
+ } else if (value is FileDialogResult) {
+ buffer.putUint8(131);
+ writeValue(buffer, value.encode());
} else {
super.writeValue(buffer, value);
}
@@ -34,12 +34,12 @@
@override
Object? readValueOfType(int type, ReadBuffer buffer) {
switch (type) {
- case 128:
- return FileDialogResult.decode(readValue(buffer)!);
case 129:
- return SelectionOptions.decode(readValue(buffer)!);
- case 130:
return TypeGroup.decode(readValue(buffer)!);
+ case 130:
+ return SelectionOptions.decode(readValue(buffer)!);
+ case 131:
+ return FileDialogResult.decode(readValue(buffer)!);
default:
return super.readValueOfType(type, buffer);
}
@@ -49,7 +49,7 @@
abstract class TestFileSelectorApi {
static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding =>
TestDefaultBinaryMessengerBinding.instance;
- static const MessageCodec<Object?> codec = _TestFileSelectorApiCodec();
+ static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
FileDialogResult showOpenDialog(SelectionOptions options,
String? initialDirectory, String? confirmButtonText);
@@ -60,56 +60,79 @@
String? suggestedName,
String? confirmButtonText);
- static void setup(TestFileSelectorApi? api,
- {BinaryMessenger? binaryMessenger}) {
+ static void setUp(
+ TestFileSelectorApi? api, {
+ BinaryMessenger? binaryMessenger,
+ String messageChannelSuffix = '',
+ }) {
+ messageChannelSuffix =
+ messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
{
- final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
- 'dev.flutter.pigeon.FileSelectorApi.showOpenDialog', codec,
+ final BasicMessageChannel<Object?> __pigeon_channel = BasicMessageChannel<
+ Object?>(
+ 'dev.flutter.pigeon.file_selector_windows.FileSelectorApi.showOpenDialog$messageChannelSuffix',
+ pigeonChannelCodec,
binaryMessenger: binaryMessenger);
if (api == null) {
_testBinaryMessengerBinding!.defaultBinaryMessenger
- .setMockDecodedMessageHandler<Object?>(channel, null);
+ .setMockDecodedMessageHandler<Object?>(__pigeon_channel, null);
} else {
_testBinaryMessengerBinding!.defaultBinaryMessenger
- .setMockDecodedMessageHandler<Object?>(channel,
+ .setMockDecodedMessageHandler<Object?>(__pigeon_channel,
(Object? message) async {
assert(message != null,
- 'Argument for dev.flutter.pigeon.FileSelectorApi.showOpenDialog was null.');
+ 'Argument for dev.flutter.pigeon.file_selector_windows.FileSelectorApi.showOpenDialog was null.');
final List<Object?> args = (message as List<Object?>?)!;
final SelectionOptions? arg_options = (args[0] as SelectionOptions?);
assert(arg_options != null,
- 'Argument for dev.flutter.pigeon.FileSelectorApi.showOpenDialog was null, expected non-null SelectionOptions.');
+ 'Argument for dev.flutter.pigeon.file_selector_windows.FileSelectorApi.showOpenDialog was null, expected non-null SelectionOptions.');
final String? arg_initialDirectory = (args[1] as String?);
final String? arg_confirmButtonText = (args[2] as String?);
- final FileDialogResult output = api.showOpenDialog(
- arg_options!, arg_initialDirectory, arg_confirmButtonText);
- return <Object?>[output];
+ try {
+ final FileDialogResult output = api.showOpenDialog(
+ arg_options!, arg_initialDirectory, arg_confirmButtonText);
+ return <Object?>[output];
+ } on PlatformException catch (e) {
+ return wrapResponse(error: e);
+ } catch (e) {
+ return wrapResponse(
+ error: PlatformException(code: 'error', message: e.toString()));
+ }
});
}
}
{
- final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
- 'dev.flutter.pigeon.FileSelectorApi.showSaveDialog', codec,
+ final BasicMessageChannel<Object?> __pigeon_channel = BasicMessageChannel<
+ Object?>(
+ 'dev.flutter.pigeon.file_selector_windows.FileSelectorApi.showSaveDialog$messageChannelSuffix',
+ pigeonChannelCodec,
binaryMessenger: binaryMessenger);
if (api == null) {
_testBinaryMessengerBinding!.defaultBinaryMessenger
- .setMockDecodedMessageHandler<Object?>(channel, null);
+ .setMockDecodedMessageHandler<Object?>(__pigeon_channel, null);
} else {
_testBinaryMessengerBinding!.defaultBinaryMessenger
- .setMockDecodedMessageHandler<Object?>(channel,
+ .setMockDecodedMessageHandler<Object?>(__pigeon_channel,
(Object? message) async {
assert(message != null,
- 'Argument for dev.flutter.pigeon.FileSelectorApi.showSaveDialog was null.');
+ 'Argument for dev.flutter.pigeon.file_selector_windows.FileSelectorApi.showSaveDialog was null.');
final List<Object?> args = (message as List<Object?>?)!;
final SelectionOptions? arg_options = (args[0] as SelectionOptions?);
assert(arg_options != null,
- 'Argument for dev.flutter.pigeon.FileSelectorApi.showSaveDialog was null, expected non-null SelectionOptions.');
+ 'Argument for dev.flutter.pigeon.file_selector_windows.FileSelectorApi.showSaveDialog was null, expected non-null SelectionOptions.');
final String? arg_initialDirectory = (args[1] as String?);
final String? arg_suggestedName = (args[2] as String?);
final String? arg_confirmButtonText = (args[3] as String?);
- final FileDialogResult output = api.showSaveDialog(arg_options!,
- arg_initialDirectory, arg_suggestedName, arg_confirmButtonText);
- return <Object?>[output];
+ try {
+ final FileDialogResult output = api.showSaveDialog(arg_options!,
+ arg_initialDirectory, arg_suggestedName, arg_confirmButtonText);
+ return <Object?>[output];
+ } on PlatformException catch (e) {
+ return wrapResponse(error: e);
+ } catch (e) {
+ return wrapResponse(
+ error: PlatformException(code: 'error', message: e.toString()));
+ }
});
}
}
diff --git a/packages/file_selector/file_selector_windows/windows/messages.g.cpp b/packages/file_selector/file_selector_windows/windows/messages.g.cpp
index a60fd92..fc145c6 100644
--- a/packages/file_selector/file_selector_windows/windows/messages.g.cpp
+++ b/packages/file_selector/file_selector_windows/windows/messages.g.cpp
@@ -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 (v10.0.1), do not edit directly.
+// Autogenerated from Pigeon (v21.0.0), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#undef _HAS_EXCEPTIONS
@@ -24,6 +24,13 @@
using flutter::EncodableMap;
using flutter::EncodableValue;
+FlutterError CreateConnectionError(const std::string channel_name) {
+ return FlutterError(
+ "channel-error",
+ "Unable to establish connection on channel: '" + channel_name + "'.",
+ EncodableValue(""));
+}
+
// TypeGroup
TypeGroup::TypeGroup(const std::string& label, const EncodableList& extensions)
@@ -147,50 +154,50 @@
return decoded;
}
-FileSelectorApiCodecSerializer::FileSelectorApiCodecSerializer() {}
+PigeonCodecSerializer::PigeonCodecSerializer() {}
-EncodableValue FileSelectorApiCodecSerializer::ReadValueOfType(
+EncodableValue PigeonCodecSerializer::ReadValueOfType(
uint8_t type, flutter::ByteStreamReader* stream) const {
switch (type) {
- case 128:
- return CustomEncodableValue(FileDialogResult::FromEncodableList(
- std::get<EncodableList>(ReadValue(stream))));
case 129:
- return CustomEncodableValue(SelectionOptions::FromEncodableList(
+ return CustomEncodableValue(TypeGroup::FromEncodableList(
std::get<EncodableList>(ReadValue(stream))));
case 130:
- return CustomEncodableValue(TypeGroup::FromEncodableList(
+ return CustomEncodableValue(SelectionOptions::FromEncodableList(
+ std::get<EncodableList>(ReadValue(stream))));
+ case 131:
+ return CustomEncodableValue(FileDialogResult::FromEncodableList(
std::get<EncodableList>(ReadValue(stream))));
default:
return flutter::StandardCodecSerializer::ReadValueOfType(type, stream);
}
}
-void FileSelectorApiCodecSerializer::WriteValue(
+void PigeonCodecSerializer::WriteValue(
const EncodableValue& value, flutter::ByteStreamWriter* stream) const {
if (const CustomEncodableValue* custom_value =
std::get_if<CustomEncodableValue>(&value)) {
- if (custom_value->type() == typeid(FileDialogResult)) {
- stream->WriteByte(128);
- WriteValue(
- EncodableValue(
- std::any_cast<FileDialogResult>(*custom_value).ToEncodableList()),
- stream);
+ if (custom_value->type() == typeid(TypeGroup)) {
+ stream->WriteByte(129);
+ WriteValue(EncodableValue(
+ std::any_cast<TypeGroup>(*custom_value).ToEncodableList()),
+ stream);
return;
}
if (custom_value->type() == typeid(SelectionOptions)) {
- stream->WriteByte(129);
+ stream->WriteByte(130);
WriteValue(
EncodableValue(
std::any_cast<SelectionOptions>(*custom_value).ToEncodableList()),
stream);
return;
}
- if (custom_value->type() == typeid(TypeGroup)) {
- stream->WriteByte(130);
- WriteValue(EncodableValue(
- std::any_cast<TypeGroup>(*custom_value).ToEncodableList()),
- stream);
+ if (custom_value->type() == typeid(FileDialogResult)) {
+ stream->WriteByte(131);
+ WriteValue(
+ EncodableValue(
+ std::any_cast<FileDialogResult>(*custom_value).ToEncodableList()),
+ stream);
return;
}
}
@@ -200,19 +207,31 @@
/// The codec used by FileSelectorApi.
const flutter::StandardMessageCodec& FileSelectorApi::GetCodec() {
return flutter::StandardMessageCodec::GetInstance(
- &FileSelectorApiCodecSerializer::GetInstance());
+ &PigeonCodecSerializer::GetInstance());
}
// Sets up an instance of `FileSelectorApi` to handle messages through the
// `binary_messenger`.
void FileSelectorApi::SetUp(flutter::BinaryMessenger* binary_messenger,
FileSelectorApi* api) {
+ FileSelectorApi::SetUp(binary_messenger, api, "");
+}
+
+void FileSelectorApi::SetUp(flutter::BinaryMessenger* binary_messenger,
+ FileSelectorApi* api,
+ const std::string& message_channel_suffix) {
+ const std::string prepended_suffix =
+ message_channel_suffix.length() > 0
+ ? std::string(".") + message_channel_suffix
+ : "";
{
- auto channel = std::make_unique<BasicMessageChannel<>>(
- binary_messenger, "dev.flutter.pigeon.FileSelectorApi.showOpenDialog",
- &GetCodec());
+ BasicMessageChannel<> channel(binary_messenger,
+ "dev.flutter.pigeon.file_selector_windows."
+ "FileSelectorApi.showOpenDialog" +
+ prepended_suffix,
+ &GetCodec());
if (api != nullptr) {
- channel->SetMessageHandler(
+ channel.SetMessageHandler(
[api](const EncodableValue& message,
const flutter::MessageReply<EncodableValue>& reply) {
try {
@@ -245,15 +264,17 @@
}
});
} else {
- channel->SetMessageHandler(nullptr);
+ channel.SetMessageHandler(nullptr);
}
}
{
- auto channel = std::make_unique<BasicMessageChannel<>>(
- binary_messenger, "dev.flutter.pigeon.FileSelectorApi.showSaveDialog",
- &GetCodec());
+ BasicMessageChannel<> channel(binary_messenger,
+ "dev.flutter.pigeon.file_selector_windows."
+ "FileSelectorApi.showSaveDialog" +
+ prepended_suffix,
+ &GetCodec());
if (api != nullptr) {
- channel->SetMessageHandler(
+ channel.SetMessageHandler(
[api](const EncodableValue& message,
const flutter::MessageReply<EncodableValue>& reply) {
try {
@@ -290,7 +311,7 @@
}
});
} else {
- channel->SetMessageHandler(nullptr);
+ channel.SetMessageHandler(nullptr);
}
}
}
diff --git a/packages/file_selector/file_selector_windows/windows/messages.g.h b/packages/file_selector/file_selector_windows/windows/messages.g.h
index ab8afd7..43f6714 100644
--- a/packages/file_selector/file_selector_windows/windows/messages.g.h
+++ b/packages/file_selector/file_selector_windows/windows/messages.g.h
@@ -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 (v10.0.1), do not edit directly.
+// Autogenerated from Pigeon (v21.0.0), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#ifndef PIGEON_MESSAGES_G_H_
@@ -75,7 +75,7 @@
static TypeGroup FromEncodableList(const flutter::EncodableList& list);
flutter::EncodableList ToEncodableList() const;
friend class FileSelectorApi;
- friend class FileSelectorApiCodecSerializer;
+ friend class PigeonCodecSerializer;
std::string label_;
flutter::EncodableList extensions_;
};
@@ -100,7 +100,7 @@
static SelectionOptions FromEncodableList(const flutter::EncodableList& list);
flutter::EncodableList ToEncodableList() const;
friend class FileSelectorApi;
- friend class FileSelectorApiCodecSerializer;
+ friend class PigeonCodecSerializer;
bool allow_multiple_;
bool select_folders_;
flutter::EncodableList allowed_types_;
@@ -136,16 +136,16 @@
static FileDialogResult FromEncodableList(const flutter::EncodableList& list);
flutter::EncodableList ToEncodableList() const;
friend class FileSelectorApi;
- friend class FileSelectorApiCodecSerializer;
+ friend class PigeonCodecSerializer;
flutter::EncodableList paths_;
std::optional<int64_t> type_group_index_;
};
-class FileSelectorApiCodecSerializer : public flutter::StandardCodecSerializer {
+class PigeonCodecSerializer : public flutter::StandardCodecSerializer {
public:
- FileSelectorApiCodecSerializer();
- inline static FileSelectorApiCodecSerializer& GetInstance() {
- static FileSelectorApiCodecSerializer sInstance;
+ PigeonCodecSerializer();
+ inline static PigeonCodecSerializer& GetInstance() {
+ static PigeonCodecSerializer sInstance;
return sInstance;
}
@@ -178,6 +178,9 @@
// `binary_messenger`.
static void SetUp(flutter::BinaryMessenger* binary_messenger,
FileSelectorApi* api);
+ static void SetUp(flutter::BinaryMessenger* binary_messenger,
+ FileSelectorApi* api,
+ const std::string& message_channel_suffix);
static flutter::EncodableValue WrapError(std::string_view error_message);
static flutter::EncodableValue WrapError(const FlutterError& error);
diff --git a/packages/local_auth/local_auth_windows/CHANGELOG.md b/packages/local_auth/local_auth_windows/CHANGELOG.md
index 46d66ba..321e78c 100644
--- a/packages/local_auth/local_auth_windows/CHANGELOG.md
+++ b/packages/local_auth/local_auth_windows/CHANGELOG.md
@@ -1,5 +1,6 @@
-## NEXT
+## 1.0.11
+* Updates to pigeon 21.
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
## 1.0.10
diff --git a/packages/local_auth/local_auth_windows/lib/src/messages.g.dart b/packages/local_auth/local_auth_windows/lib/src/messages.g.dart
index f303a08..e1c45ef 100644
--- a/packages/local_auth/local_auth_windows/lib/src/messages.g.dart
+++ b/packages/local_auth/local_auth_windows/lib/src/messages.g.dart
@@ -1,9 +1,9 @@
// 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 (v10.1.2), do not edit directly.
+// Autogenerated from Pigeon (v21.0.0), 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
+// 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
import 'dart:async';
import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List;
@@ -11,40 +11,59 @@
import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer;
import 'package:flutter/services.dart';
+PlatformException _createConnectionError(String channelName) {
+ return PlatformException(
+ code: 'channel-error',
+ message: 'Unable to establish connection on channel: "$channelName".',
+ );
+}
+
+class _PigeonCodec extends StandardMessageCodec {
+ const _PigeonCodec();
+}
+
class LocalAuthApi {
/// Constructor for [LocalAuthApi]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default
/// BinaryMessenger will be used which routes to the host platform.
- LocalAuthApi({BinaryMessenger? binaryMessenger})
- : _binaryMessenger = binaryMessenger;
- final BinaryMessenger? _binaryMessenger;
+ LocalAuthApi(
+ {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
+ : __pigeon_binaryMessenger = binaryMessenger,
+ __pigeon_messageChannelSuffix =
+ messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
+ final BinaryMessenger? __pigeon_binaryMessenger;
- static const MessageCodec<Object?> codec = StandardMessageCodec();
+ static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
+
+ final String __pigeon_messageChannelSuffix;
/// Returns true if this device supports authentication.
Future<bool> isDeviceSupported() async {
- final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
- 'dev.flutter.pigeon.LocalAuthApi.isDeviceSupported', codec,
- binaryMessenger: _binaryMessenger);
- final List<Object?>? replyList = await channel.send(null) as List<Object?>?;
- if (replyList == null) {
+ final String __pigeon_channelName =
+ 'dev.flutter.pigeon.local_auth_windows.LocalAuthApi.isDeviceSupported$__pigeon_messageChannelSuffix';
+ final BasicMessageChannel<Object?> __pigeon_channel =
+ BasicMessageChannel<Object?>(
+ __pigeon_channelName,
+ pigeonChannelCodec,
+ binaryMessenger: __pigeon_binaryMessenger,
+ );
+ final List<Object?>? __pigeon_replyList =
+ await __pigeon_channel.send(null) as List<Object?>?;
+ if (__pigeon_replyList == null) {
+ throw _createConnectionError(__pigeon_channelName);
+ } else if (__pigeon_replyList.length > 1) {
throw PlatformException(
- code: 'channel-error',
- message: 'Unable to establish connection on channel.',
+ code: __pigeon_replyList[0]! as String,
+ message: __pigeon_replyList[1] as String?,
+ details: __pigeon_replyList[2],
);
- } else if (replyList.length > 1) {
- throw PlatformException(
- code: replyList[0]! as String,
- message: replyList[1] as String?,
- details: replyList[2],
- );
- } else if (replyList[0] == null) {
+ } else if (__pigeon_replyList[0] == null) {
throw PlatformException(
code: 'null-error',
message: 'Host platform returned null value for non-null return value.',
);
} else {
- return (replyList[0] as bool?)!;
+ return (__pigeon_replyList[0] as bool?)!;
}
}
@@ -53,30 +72,32 @@
///
/// Returns true if authorization succeeds, false if it is attempted but is
/// not successful, and an error if authorization could not be attempted.
- Future<bool> authenticate(String arg_localizedReason) async {
- final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
- 'dev.flutter.pigeon.LocalAuthApi.authenticate', codec,
- binaryMessenger: _binaryMessenger);
- final List<Object?>? replyList =
- await channel.send(<Object?>[arg_localizedReason]) as List<Object?>?;
- if (replyList == null) {
+ Future<bool> authenticate(String localizedReason) async {
+ final String __pigeon_channelName =
+ 'dev.flutter.pigeon.local_auth_windows.LocalAuthApi.authenticate$__pigeon_messageChannelSuffix';
+ final BasicMessageChannel<Object?> __pigeon_channel =
+ BasicMessageChannel<Object?>(
+ __pigeon_channelName,
+ pigeonChannelCodec,
+ binaryMessenger: __pigeon_binaryMessenger,
+ );
+ final List<Object?>? __pigeon_replyList = await __pigeon_channel
+ .send(<Object?>[localizedReason]) as List<Object?>?;
+ if (__pigeon_replyList == null) {
+ throw _createConnectionError(__pigeon_channelName);
+ } else if (__pigeon_replyList.length > 1) {
throw PlatformException(
- code: 'channel-error',
- message: 'Unable to establish connection on channel.',
+ code: __pigeon_replyList[0]! as String,
+ message: __pigeon_replyList[1] as String?,
+ details: __pigeon_replyList[2],
);
- } else if (replyList.length > 1) {
- throw PlatformException(
- code: replyList[0]! as String,
- message: replyList[1] as String?,
- details: replyList[2],
- );
- } else if (replyList[0] == null) {
+ } else if (__pigeon_replyList[0] == null) {
throw PlatformException(
code: 'null-error',
message: 'Host platform returned null value for non-null return value.',
);
} else {
- return (replyList[0] as bool?)!;
+ return (__pigeon_replyList[0] as bool?)!;
}
}
}
diff --git a/packages/local_auth/local_auth_windows/pubspec.yaml b/packages/local_auth/local_auth_windows/pubspec.yaml
index 52a4240..b275c09 100644
--- a/packages/local_auth/local_auth_windows/pubspec.yaml
+++ b/packages/local_auth/local_auth_windows/pubspec.yaml
@@ -2,7 +2,7 @@
description: Windows implementation of the local_auth plugin.
repository: https://github.com/flutter/packages/tree/main/packages/local_auth/local_auth_windows
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+local_auth%22
-version: 1.0.10
+version: 1.0.11
environment:
sdk: ^3.2.0
@@ -24,7 +24,7 @@
dev_dependencies:
flutter_test:
sdk: flutter
- pigeon: ^10.1.2
+ pigeon: ^21.0.0
topics:
- authentication
diff --git a/packages/local_auth/local_auth_windows/windows/messages.g.cpp b/packages/local_auth/local_auth_windows/windows/messages.g.cpp
index 6b77190..ce0f578 100644
--- a/packages/local_auth/local_auth_windows/windows/messages.g.cpp
+++ b/packages/local_auth/local_auth_windows/windows/messages.g.cpp
@@ -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 (v10.1.2), do not edit directly.
+// Autogenerated from Pigeon (v21.0.0), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#undef _HAS_EXCEPTIONS
@@ -24,22 +24,53 @@
using flutter::EncodableMap;
using flutter::EncodableValue;
+FlutterError CreateConnectionError(const std::string channel_name) {
+ return FlutterError(
+ "channel-error",
+ "Unable to establish connection on channel: '" + channel_name + "'.",
+ EncodableValue(""));
+}
+
+PigeonCodecSerializer::PigeonCodecSerializer() {}
+
+EncodableValue PigeonCodecSerializer::ReadValueOfType(
+ uint8_t type, flutter::ByteStreamReader* stream) const {
+ return flutter::StandardCodecSerializer::ReadValueOfType(type, stream);
+}
+
+void PigeonCodecSerializer::WriteValue(
+ const EncodableValue& value, flutter::ByteStreamWriter* stream) const {
+ flutter::StandardCodecSerializer::WriteValue(value, stream);
+}
+
/// The codec used by LocalAuthApi.
const flutter::StandardMessageCodec& LocalAuthApi::GetCodec() {
return flutter::StandardMessageCodec::GetInstance(
- &flutter::StandardCodecSerializer::GetInstance());
+ &PigeonCodecSerializer::GetInstance());
}
// Sets up an instance of `LocalAuthApi` to handle messages through the
// `binary_messenger`.
void LocalAuthApi::SetUp(flutter::BinaryMessenger* binary_messenger,
LocalAuthApi* api) {
+ LocalAuthApi::SetUp(binary_messenger, api, "");
+}
+
+void LocalAuthApi::SetUp(flutter::BinaryMessenger* binary_messenger,
+ LocalAuthApi* api,
+ const std::string& message_channel_suffix) {
+ const std::string prepended_suffix =
+ message_channel_suffix.length() > 0
+ ? std::string(".") + message_channel_suffix
+ : "";
{
- auto channel = std::make_unique<BasicMessageChannel<>>(
- binary_messenger, "dev.flutter.pigeon.LocalAuthApi.isDeviceSupported",
+ BasicMessageChannel<> channel(
+ binary_messenger,
+ "dev.flutter.pigeon.local_auth_windows.LocalAuthApi.isDeviceSupported" +
+ prepended_suffix,
&GetCodec());
if (api != nullptr) {
- channel->SetMessageHandler(
+ channel.SetMessageHandler(
[api](const EncodableValue& message,
const flutter::MessageReply<EncodableValue>& reply) {
try {
@@ -58,15 +89,17 @@
}
});
} else {
- channel->SetMessageHandler(nullptr);
+ channel.SetMessageHandler(nullptr);
}
}
{
- auto channel = std::make_unique<BasicMessageChannel<>>(
- binary_messenger, "dev.flutter.pigeon.LocalAuthApi.authenticate",
+ BasicMessageChannel<> channel(
+ binary_messenger,
+ "dev.flutter.pigeon.local_auth_windows.LocalAuthApi.authenticate" +
+ prepended_suffix,
&GetCodec());
if (api != nullptr) {
- channel->SetMessageHandler(
+ channel.SetMessageHandler(
[api](const EncodableValue& message,
const flutter::MessageReply<EncodableValue>& reply) {
try {
@@ -94,7 +127,7 @@
}
});
} else {
- channel->SetMessageHandler(nullptr);
+ channel.SetMessageHandler(nullptr);
}
}
}
diff --git a/packages/local_auth/local_auth_windows/windows/messages.g.h b/packages/local_auth/local_auth_windows/windows/messages.g.h
index 60a8095..60d35fe 100644
--- a/packages/local_auth/local_auth_windows/windows/messages.g.h
+++ b/packages/local_auth/local_auth_windows/windows/messages.g.h
@@ -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 (v10.1.2), do not edit directly.
+// Autogenerated from Pigeon (v21.0.0), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#ifndef PIGEON_MESSAGES_G_H_
@@ -58,6 +58,22 @@
std::variant<T, FlutterError> v_;
};
+class PigeonCodecSerializer : public flutter::StandardCodecSerializer {
+ public:
+ PigeonCodecSerializer();
+ inline static PigeonCodecSerializer& GetInstance() {
+ static PigeonCodecSerializer sInstance;
+ return sInstance;
+ }
+
+ void WriteValue(const flutter::EncodableValue& value,
+ flutter::ByteStreamWriter* stream) const override;
+
+ protected:
+ flutter::EncodableValue ReadValueOfType(
+ uint8_t type, flutter::ByteStreamReader* stream) const override;
+};
+
// Generated interface from Pigeon that represents a handler of messages from
// Flutter.
class LocalAuthApi {
@@ -83,6 +99,9 @@
// `binary_messenger`.
static void SetUp(flutter::BinaryMessenger* binary_messenger,
LocalAuthApi* api);
+ static void SetUp(flutter::BinaryMessenger* binary_messenger,
+ LocalAuthApi* api,
+ const std::string& message_channel_suffix);
static flutter::EncodableValue WrapError(std::string_view error_message);
static flutter::EncodableValue WrapError(const FlutterError& error);
diff --git a/packages/url_launcher/url_launcher_windows/CHANGELOG.md b/packages/url_launcher/url_launcher_windows/CHANGELOG.md
index 978a224..6382593 100644
--- a/packages/url_launcher/url_launcher_windows/CHANGELOG.md
+++ b/packages/url_launcher/url_launcher_windows/CHANGELOG.md
@@ -1,5 +1,6 @@
-## NEXT
+## 3.1.2
+* Updates to pigeon 21.
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
## 3.1.1
diff --git a/packages/url_launcher/url_launcher_windows/lib/src/messages.g.dart b/packages/url_launcher/url_launcher_windows/lib/src/messages.g.dart
index 2d84f68..f076f3e 100644
--- a/packages/url_launcher/url_launcher_windows/lib/src/messages.g.dart
+++ b/packages/url_launcher/url_launcher_windows/lib/src/messages.g.dart
@@ -1,9 +1,9 @@
// 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 (v13.0.0), do not edit directly.
+// Autogenerated from Pigeon (v21.0.0), 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
+// 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
import 'dart:async';
import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List;
@@ -11,80 +11,87 @@
import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer;
import 'package:flutter/services.dart';
-List<Object?> wrapResponse(
- {Object? result, PlatformException? error, bool empty = false}) {
- if (empty) {
- return <Object?>[];
- }
- if (error == null) {
- return <Object?>[result];
- }
- return <Object?>[error.code, error.message, error.details];
+PlatformException _createConnectionError(String channelName) {
+ return PlatformException(
+ code: 'channel-error',
+ message: 'Unable to establish connection on channel: "$channelName".',
+ );
+}
+
+class _PigeonCodec extends StandardMessageCodec {
+ const _PigeonCodec();
}
class UrlLauncherApi {
/// Constructor for [UrlLauncherApi]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default
/// BinaryMessenger will be used which routes to the host platform.
- UrlLauncherApi({BinaryMessenger? binaryMessenger})
- : _binaryMessenger = binaryMessenger;
- final BinaryMessenger? _binaryMessenger;
+ UrlLauncherApi(
+ {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
+ : __pigeon_binaryMessenger = binaryMessenger,
+ __pigeon_messageChannelSuffix =
+ messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
+ final BinaryMessenger? __pigeon_binaryMessenger;
- static const MessageCodec<Object?> codec = StandardMessageCodec();
+ static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
- Future<bool> canLaunchUrl(String arg_url) async {
- final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
- 'dev.flutter.pigeon.url_launcher_windows.UrlLauncherApi.canLaunchUrl',
- codec,
- binaryMessenger: _binaryMessenger);
- final List<Object?>? replyList =
- await channel.send(<Object?>[arg_url]) as List<Object?>?;
- if (replyList == null) {
+ final String __pigeon_messageChannelSuffix;
+
+ Future<bool> canLaunchUrl(String url) async {
+ final String __pigeon_channelName =
+ 'dev.flutter.pigeon.url_launcher_windows.UrlLauncherApi.canLaunchUrl$__pigeon_messageChannelSuffix';
+ final BasicMessageChannel<Object?> __pigeon_channel =
+ BasicMessageChannel<Object?>(
+ __pigeon_channelName,
+ pigeonChannelCodec,
+ binaryMessenger: __pigeon_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) {
throw PlatformException(
- code: 'channel-error',
- message: 'Unable to establish connection on channel.',
+ code: __pigeon_replyList[0]! as String,
+ message: __pigeon_replyList[1] as String?,
+ details: __pigeon_replyList[2],
);
- } else if (replyList.length > 1) {
- throw PlatformException(
- code: replyList[0]! as String,
- message: replyList[1] as String?,
- details: replyList[2],
- );
- } else if (replyList[0] == null) {
+ } else if (__pigeon_replyList[0] == null) {
throw PlatformException(
code: 'null-error',
message: 'Host platform returned null value for non-null return value.',
);
} else {
- return (replyList[0] as bool?)!;
+ return (__pigeon_replyList[0] as bool?)!;
}
}
- Future<bool> launchUrl(String arg_url) async {
- final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
- 'dev.flutter.pigeon.url_launcher_windows.UrlLauncherApi.launchUrl',
- codec,
- binaryMessenger: _binaryMessenger);
- final List<Object?>? replyList =
- await channel.send(<Object?>[arg_url]) as List<Object?>?;
- if (replyList == null) {
+ Future<bool> launchUrl(String url) async {
+ final String __pigeon_channelName =
+ 'dev.flutter.pigeon.url_launcher_windows.UrlLauncherApi.launchUrl$__pigeon_messageChannelSuffix';
+ final BasicMessageChannel<Object?> __pigeon_channel =
+ BasicMessageChannel<Object?>(
+ __pigeon_channelName,
+ pigeonChannelCodec,
+ binaryMessenger: __pigeon_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) {
throw PlatformException(
- code: 'channel-error',
- message: 'Unable to establish connection on channel.',
+ code: __pigeon_replyList[0]! as String,
+ message: __pigeon_replyList[1] as String?,
+ details: __pigeon_replyList[2],
);
- } else if (replyList.length > 1) {
- throw PlatformException(
- code: replyList[0]! as String,
- message: replyList[1] as String?,
- details: replyList[2],
- );
- } else if (replyList[0] == null) {
+ } else if (__pigeon_replyList[0] == null) {
throw PlatformException(
code: 'null-error',
message: 'Host platform returned null value for non-null return value.',
);
} else {
- return (replyList[0] as bool?)!;
+ return (__pigeon_replyList[0] as bool?)!;
}
}
}
diff --git a/packages/url_launcher/url_launcher_windows/pubspec.yaml b/packages/url_launcher/url_launcher_windows/pubspec.yaml
index 214806e..8d22ee9 100644
--- a/packages/url_launcher/url_launcher_windows/pubspec.yaml
+++ b/packages/url_launcher/url_launcher_windows/pubspec.yaml
@@ -2,7 +2,7 @@
description: Windows implementation of the url_launcher plugin.
repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_windows
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22
-version: 3.1.1
+version: 3.1.2
environment:
sdk: ^3.2.0
@@ -24,7 +24,7 @@
dev_dependencies:
flutter_test:
sdk: flutter
- pigeon: ^13.0.0
+ pigeon: ^21.0.0
test: ^1.16.3
topics:
diff --git a/packages/url_launcher/url_launcher_windows/windows/messages.g.cpp b/packages/url_launcher/url_launcher_windows/windows/messages.g.cpp
index 43c6254..babca59 100644
--- a/packages/url_launcher/url_launcher_windows/windows/messages.g.cpp
+++ b/packages/url_launcher/url_launcher_windows/windows/messages.g.cpp
@@ -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 (v13.0.0), do not edit directly.
+// Autogenerated from Pigeon (v21.0.0), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#undef _HAS_EXCEPTIONS
@@ -24,23 +24,53 @@
using flutter::EncodableMap;
using flutter::EncodableValue;
+FlutterError CreateConnectionError(const std::string channel_name) {
+ return FlutterError(
+ "channel-error",
+ "Unable to establish connection on channel: '" + channel_name + "'.",
+ EncodableValue(""));
+}
+
+PigeonCodecSerializer::PigeonCodecSerializer() {}
+
+EncodableValue PigeonCodecSerializer::ReadValueOfType(
+ uint8_t type, flutter::ByteStreamReader* stream) const {
+ return flutter::StandardCodecSerializer::ReadValueOfType(type, stream);
+}
+
+void PigeonCodecSerializer::WriteValue(
+ const EncodableValue& value, flutter::ByteStreamWriter* stream) const {
+ flutter::StandardCodecSerializer::WriteValue(value, stream);
+}
+
/// The codec used by UrlLauncherApi.
const flutter::StandardMessageCodec& UrlLauncherApi::GetCodec() {
return flutter::StandardMessageCodec::GetInstance(
- &flutter::StandardCodecSerializer::GetInstance());
+ &PigeonCodecSerializer::GetInstance());
}
// Sets up an instance of `UrlLauncherApi` to handle messages through the
// `binary_messenger`.
void UrlLauncherApi::SetUp(flutter::BinaryMessenger* binary_messenger,
UrlLauncherApi* api) {
+ UrlLauncherApi::SetUp(binary_messenger, api, "");
+}
+
+void UrlLauncherApi::SetUp(flutter::BinaryMessenger* binary_messenger,
+ UrlLauncherApi* api,
+ const std::string& message_channel_suffix) {
+ const std::string prepended_suffix =
+ message_channel_suffix.length() > 0
+ ? std::string(".") + message_channel_suffix
+ : "";
{
- auto channel = std::make_unique<BasicMessageChannel<>>(
+ BasicMessageChannel<> channel(
binary_messenger,
- "dev.flutter.pigeon.url_launcher_windows.UrlLauncherApi.canLaunchUrl",
+ "dev.flutter.pigeon.url_launcher_windows.UrlLauncherApi.canLaunchUrl" +
+ prepended_suffix,
&GetCodec());
if (api != nullptr) {
- channel->SetMessageHandler(
+ channel.SetMessageHandler(
[api](const EncodableValue& message,
const flutter::MessageReply<EncodableValue>& reply) {
try {
@@ -64,16 +94,17 @@
}
});
} else {
- channel->SetMessageHandler(nullptr);
+ channel.SetMessageHandler(nullptr);
}
}
{
- auto channel = std::make_unique<BasicMessageChannel<>>(
+ BasicMessageChannel<> channel(
binary_messenger,
- "dev.flutter.pigeon.url_launcher_windows.UrlLauncherApi.launchUrl",
+ "dev.flutter.pigeon.url_launcher_windows.UrlLauncherApi.launchUrl" +
+ prepended_suffix,
&GetCodec());
if (api != nullptr) {
- channel->SetMessageHandler(
+ channel.SetMessageHandler(
[api](const EncodableValue& message,
const flutter::MessageReply<EncodableValue>& reply) {
try {
@@ -97,7 +128,7 @@
}
});
} else {
- channel->SetMessageHandler(nullptr);
+ channel.SetMessageHandler(nullptr);
}
}
}
diff --git a/packages/url_launcher/url_launcher_windows/windows/messages.g.h b/packages/url_launcher/url_launcher_windows/windows/messages.g.h
index f725b01..c940969 100644
--- a/packages/url_launcher/url_launcher_windows/windows/messages.g.h
+++ b/packages/url_launcher/url_launcher_windows/windows/messages.g.h
@@ -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 (v13.0.0), do not edit directly.
+// Autogenerated from Pigeon (v21.0.0), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#ifndef PIGEON_MESSAGES_G_H_
@@ -58,6 +58,22 @@
std::variant<T, FlutterError> v_;
};
+class PigeonCodecSerializer : public flutter::StandardCodecSerializer {
+ public:
+ PigeonCodecSerializer();
+ inline static PigeonCodecSerializer& GetInstance() {
+ static PigeonCodecSerializer sInstance;
+ return sInstance;
+ }
+
+ void WriteValue(const flutter::EncodableValue& value,
+ flutter::ByteStreamWriter* stream) const override;
+
+ protected:
+ flutter::EncodableValue ReadValueOfType(
+ uint8_t type, flutter::ByteStreamReader* stream) const override;
+};
+
// Generated interface from Pigeon that represents a handler of messages from
// Flutter.
class UrlLauncherApi {
@@ -74,6 +90,9 @@
// `binary_messenger`.
static void SetUp(flutter::BinaryMessenger* binary_messenger,
UrlLauncherApi* api);
+ static void SetUp(flutter::BinaryMessenger* binary_messenger,
+ UrlLauncherApi* api,
+ const std::string& message_channel_suffix);
static flutter::EncodableValue WrapError(std::string_view error_message);
static flutter::EncodableValue WrapError(const FlutterError& error);