[various] Update Pigeon in Swift plugins (#3663)
[various] Update Pigeon in Swift plugins
diff --git a/packages/file_selector/file_selector_macos/CHANGELOG.md b/packages/file_selector/file_selector_macos/CHANGELOG.md
index af29511..a83f525 100644
--- a/packages/file_selector/file_selector_macos/CHANGELOG.md
+++ b/packages/file_selector/file_selector_macos/CHANGELOG.md
@@ -1,5 +1,6 @@
-## NEXT
+## 0.9.0+8
+* Updates pigeon for null value handling fixes.
* Updates minimum Flutter version to 3.3.
## 0.9.0+7
diff --git a/packages/file_selector/file_selector_macos/lib/src/messages.g.dart b/packages/file_selector/file_selector_macos/lib/src/messages.g.dart
index 325afd1..e8d5a85 100644
--- a/packages/file_selector/file_selector_macos/lib/src/messages.g.dart
+++ b/packages/file_selector/file_selector_macos/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 (v9.1.1), do not edit directly.
+// Autogenerated from Pigeon (v9.2.4), 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
diff --git a/packages/file_selector/file_selector_macos/macos/Classes/messages.g.swift b/packages/file_selector/file_selector_macos/macos/Classes/messages.g.swift
index 5303e81..828c499 100644
--- a/packages/file_selector/file_selector_macos/macos/Classes/messages.g.swift
+++ b/packages/file_selector/file_selector_macos/macos/Classes/messages.g.swift
@@ -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 (v9.1.1), do not edit directly.
+// Autogenerated from Pigeon (v9.2.4), do not edit directly.
// See also: https://pub.dev/packages/pigeon
import Foundation
@@ -13,8 +13,6 @@
#error("Unsupported platform.")
#endif
-
-
private func wrapResult(_ result: Any?) -> [Any?] {
return [result]
}
@@ -34,6 +32,11 @@
]
}
+private func nilOrValue<T>(_ value: Any?) -> T? {
+ if value is NSNull { return nil }
+ return (value as Any) as! T?
+}
+
/// A Pigeon representation of the macOS portion of an `XTypeGroup`.
///
/// Generated class from Pigeon that represents data sent in messages.
@@ -77,11 +80,11 @@
static func fromList(_ list: [Any]) -> SavePanelOptions? {
var allowedFileTypes: AllowedTypes? = nil
if let allowedFileTypesList = list[0] as! [Any]? {
- allowedFileTypes = AllowedTypes.fromList(allowedFileTypesList as [Any])
+ allowedFileTypes = AllowedTypes.fromList(allowedFileTypesList)
}
- let directoryPath = list[1] as! String?
- let nameFieldStringValue = list[2] as! String?
- let prompt = list[3] as! String?
+ let directoryPath: String? = nilOrValue(list[1])
+ let nameFieldStringValue: String? = nilOrValue(list[2])
+ let prompt: String? = nilOrValue(list[3])
return SavePanelOptions(
allowedFileTypes: allowedFileTypes,
diff --git a/packages/file_selector/file_selector_macos/pubspec.yaml b/packages/file_selector/file_selector_macos/pubspec.yaml
index 125b63c..4b92226 100644
--- a/packages/file_selector/file_selector_macos/pubspec.yaml
+++ b/packages/file_selector/file_selector_macos/pubspec.yaml
@@ -2,7 +2,7 @@
description: macOS implementation of the file_selector plugin.
repository: https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_macos
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22
-version: 0.9.0+7
+version: 0.9.0+8
environment:
sdk: ">=2.18.0 <4.0.0"
@@ -27,4 +27,4 @@
flutter_test:
sdk: flutter
mockito: 5.4.0
- pigeon: ^9.1.0
+ pigeon: ^9.2.4
diff --git a/packages/file_selector/file_selector_macos/test/messages_test.g.dart b/packages/file_selector/file_selector_macos/test/messages_test.g.dart
index 0c67c79..f72a987 100644
--- a/packages/file_selector/file_selector_macos/test/messages_test.g.dart
+++ b/packages/file_selector/file_selector_macos/test/messages_test.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 (v9.1.1), do not edit directly.
+// Autogenerated from Pigeon (v9.2.4), 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: avoid_relative_lib_imports
@@ -47,6 +47,8 @@
}
abstract class TestFileSelectorApi {
+ static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding =>
+ TestDefaultBinaryMessengerBinding.instance;
static const MessageCodec<Object?> codec = _TestFileSelectorApiCodec();
/// Shows an open panel with the given [options], returning the list of
@@ -67,9 +69,12 @@
'dev.flutter.pigeon.FileSelectorApi.displayOpenPanel', codec,
binaryMessenger: binaryMessenger);
if (api == null) {
- channel.setMockMessageHandler(null);
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel, null);
} else {
- channel.setMockMessageHandler((Object? message) async {
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel,
+ (Object? message) async {
assert(message != null,
'Argument for dev.flutter.pigeon.FileSelectorApi.displayOpenPanel was null.');
final List<Object?> args = (message as List<Object?>?)!;
@@ -86,9 +91,12 @@
'dev.flutter.pigeon.FileSelectorApi.displaySavePanel', codec,
binaryMessenger: binaryMessenger);
if (api == null) {
- channel.setMockMessageHandler(null);
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel, null);
} else {
- channel.setMockMessageHandler((Object? message) async {
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel,
+ (Object? message) async {
assert(message != null,
'Argument for dev.flutter.pigeon.FileSelectorApi.displaySavePanel was null.');
final List<Object?> args = (message as List<Object?>?)!;
diff --git a/packages/path_provider/path_provider_foundation/CHANGELOG.md b/packages/path_provider/path_provider_foundation/CHANGELOG.md
index 0dfe972..d25e953 100644
--- a/packages/path_provider/path_provider_foundation/CHANGELOG.md
+++ b/packages/path_provider/path_provider_foundation/CHANGELOG.md
@@ -1,5 +1,6 @@
-## NEXT
+## 2.2.2
+* Updates pigeon for null value handling fixes.
* Updates minimum Flutter version to 3.3.
## 2.2.1
diff --git a/packages/path_provider/path_provider_foundation/darwin/Classes/messages.g.swift b/packages/path_provider/path_provider_foundation/darwin/Classes/messages.g.swift
index 7edb31b..7bfb257 100644
--- a/packages/path_provider/path_provider_foundation/darwin/Classes/messages.g.swift
+++ b/packages/path_provider/path_provider_foundation/darwin/Classes/messages.g.swift
@@ -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 (v9.1.1), do not edit directly.
+// Autogenerated from Pigeon (v9.2.4), do not edit directly.
// See also: https://pub.dev/packages/pigeon
import Foundation
@@ -13,8 +13,6 @@
#error("Unsupported platform.")
#endif
-
-
private func wrapResult(_ result: Any?) -> [Any?] {
return [result]
}
@@ -34,6 +32,11 @@
]
}
+private func nilOrValue<T>(_ value: Any?) -> T? {
+ if value is NSNull { return nil }
+ return (value as Any) as! T?
+}
+
enum DirectoryType: Int {
case applicationDocuments = 0
case applicationSupport = 1
diff --git a/packages/path_provider/path_provider_foundation/lib/messages.g.dart b/packages/path_provider/path_provider_foundation/lib/messages.g.dart
index 5132a79..7d8d87d 100644
--- a/packages/path_provider/path_provider_foundation/lib/messages.g.dart
+++ b/packages/path_provider/path_provider_foundation/lib/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 (v9.1.1), do not edit directly.
+// Autogenerated from Pigeon (v9.2.4), 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
diff --git a/packages/path_provider/path_provider_foundation/pubspec.yaml b/packages/path_provider/path_provider_foundation/pubspec.yaml
index 89e0a12..81db306 100644
--- a/packages/path_provider/path_provider_foundation/pubspec.yaml
+++ b/packages/path_provider/path_provider_foundation/pubspec.yaml
@@ -2,7 +2,7 @@
description: iOS and macOS implementation of the path_provider plugin
repository: https://github.com/flutter/packages/tree/main/packages/path_provider/path_provider_foundation
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+path_provider%22
-version: 2.2.1
+version: 2.2.2
environment:
sdk: ">=2.18.0 <4.0.0"
@@ -32,4 +32,4 @@
sdk: flutter
mockito: 5.4.0
path: ^1.8.0
- pigeon: ^9.1.0
+ pigeon: ^9.2.4
diff --git a/packages/path_provider/path_provider_foundation/test/messages_test.g.dart b/packages/path_provider/path_provider_foundation/test/messages_test.g.dart
index 3525bee..ed00e2a 100644
--- a/packages/path_provider/path_provider_foundation/test/messages_test.g.dart
+++ b/packages/path_provider/path_provider_foundation/test/messages_test.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 (v9.1.1), do not edit directly.
+// Autogenerated from Pigeon (v9.2.4), 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: avoid_relative_lib_imports
@@ -14,6 +14,8 @@
import 'package:path_provider_foundation/messages.g.dart';
abstract class TestPathProviderApi {
+ static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding =>
+ TestDefaultBinaryMessengerBinding.instance;
static const MessageCodec<Object?> codec = StandardMessageCodec();
String? getDirectoryPath(DirectoryType type);
@@ -27,9 +29,12 @@
'dev.flutter.pigeon.PathProviderApi.getDirectoryPath', codec,
binaryMessenger: binaryMessenger);
if (api == null) {
- channel.setMockMessageHandler(null);
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel, null);
} else {
- channel.setMockMessageHandler((Object? message) async {
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel,
+ (Object? message) async {
assert(message != null,
'Argument for dev.flutter.pigeon.PathProviderApi.getDirectoryPath was null.');
final List<Object?> args = (message as List<Object?>?)!;
@@ -47,9 +52,12 @@
'dev.flutter.pigeon.PathProviderApi.getContainerPath', codec,
binaryMessenger: binaryMessenger);
if (api == null) {
- channel.setMockMessageHandler(null);
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel, null);
} else {
- channel.setMockMessageHandler((Object? message) async {
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel,
+ (Object? message) async {
assert(message != null,
'Argument for dev.flutter.pigeon.PathProviderApi.getContainerPath was null.');
final List<Object?> args = (message as List<Object?>?)!;
diff --git a/packages/shared_preferences/shared_preferences_foundation/CHANGELOG.md b/packages/shared_preferences/shared_preferences_foundation/CHANGELOG.md
index d5a6fa2..78d862f 100644
--- a/packages/shared_preferences/shared_preferences_foundation/CHANGELOG.md
+++ b/packages/shared_preferences/shared_preferences_foundation/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 2.2.1
+
+* Updates pigeon for null value handling fixes.
+
## 2.2.0
* Adds `getAllWithPrefix` and `clearWithPrefix` methods.
diff --git a/packages/shared_preferences/shared_preferences_foundation/darwin/Classes/messages.g.swift b/packages/shared_preferences/shared_preferences_foundation/darwin/Classes/messages.g.swift
index 57a08e8..9795c52 100644
--- a/packages/shared_preferences/shared_preferences_foundation/darwin/Classes/messages.g.swift
+++ b/packages/shared_preferences/shared_preferences_foundation/darwin/Classes/messages.g.swift
@@ -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 (v9.1.0), do not edit directly.
+// Autogenerated from Pigeon (v9.2.4), do not edit directly.
// See also: https://pub.dev/packages/pigeon
import Foundation
@@ -13,8 +13,6 @@
#error("Unsupported platform.")
#endif
-
-
private func wrapResult(_ result: Any?) -> [Any?] {
return [result]
}
@@ -33,6 +31,11 @@
"Stacktrace: \(Thread.callStackSymbols)"
]
}
+
+private func nilOrValue<T>(_ value: Any?) -> T? {
+ if value is NSNull { return nil }
+ return (value as Any) as! T?
+}
/// Generated protocol from Pigeon that represents a handler of messages from Flutter.
protocol UserDefaultsApi {
func remove(key: String) throws
diff --git a/packages/shared_preferences/shared_preferences_foundation/lib/messages.g.dart b/packages/shared_preferences/shared_preferences_foundation/lib/messages.g.dart
index a74c34d..9f36470 100644
--- a/packages/shared_preferences/shared_preferences_foundation/lib/messages.g.dart
+++ b/packages/shared_preferences/shared_preferences_foundation/lib/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 (v9.1.0), do not edit directly.
+// Autogenerated from Pigeon (v9.2.4), 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
diff --git a/packages/shared_preferences/shared_preferences_foundation/pubspec.yaml b/packages/shared_preferences/shared_preferences_foundation/pubspec.yaml
index b6b91cc..ba453d0 100644
--- a/packages/shared_preferences/shared_preferences_foundation/pubspec.yaml
+++ b/packages/shared_preferences/shared_preferences_foundation/pubspec.yaml
@@ -2,7 +2,7 @@
description: iOS and macOS implementation of the shared_preferences plugin.
repository: https://github.com/flutter/packages/tree/main/packages/shared_preferences/shared_preferences_foundation
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+shared_preferences%22
-version: 2.2.0
+version: 2.2.1
environment:
sdk: ">=2.17.0 <4.0.0"
@@ -29,4 +29,4 @@
dev_dependencies:
flutter_test:
sdk: flutter
- pigeon: ^9.0.0
+ pigeon: ^9.2.4
diff --git a/packages/shared_preferences/shared_preferences_foundation/test/test_api.g.dart b/packages/shared_preferences/shared_preferences_foundation/test/test_api.g.dart
index bbc0d2a..c581d51 100644
--- a/packages/shared_preferences/shared_preferences_foundation/test/test_api.g.dart
+++ b/packages/shared_preferences/shared_preferences_foundation/test/test_api.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 (v9.1.0), do not edit directly.
+// Autogenerated from Pigeon (v9.2.4), 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: avoid_relative_lib_imports
@@ -14,6 +14,8 @@
import 'package:shared_preferences_foundation/messages.g.dart';
abstract class TestUserDefaultsApi {
+ static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding =>
+ TestDefaultBinaryMessengerBinding.instance;
static const MessageCodec<Object?> codec = StandardMessageCodec();
void remove(String key);
@@ -35,9 +37,12 @@
'dev.flutter.pigeon.UserDefaultsApi.remove', codec,
binaryMessenger: binaryMessenger);
if (api == null) {
- channel.setMockMessageHandler(null);
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel, null);
} else {
- channel.setMockMessageHandler((Object? message) async {
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel,
+ (Object? message) async {
assert(message != null,
'Argument for dev.flutter.pigeon.UserDefaultsApi.remove was null.');
final List<Object?> args = (message as List<Object?>?)!;
@@ -54,9 +59,12 @@
'dev.flutter.pigeon.UserDefaultsApi.setBool', codec,
binaryMessenger: binaryMessenger);
if (api == null) {
- channel.setMockMessageHandler(null);
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel, null);
} else {
- channel.setMockMessageHandler((Object? message) async {
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel,
+ (Object? message) async {
assert(message != null,
'Argument for dev.flutter.pigeon.UserDefaultsApi.setBool was null.');
final List<Object?> args = (message as List<Object?>?)!;
@@ -76,9 +84,12 @@
'dev.flutter.pigeon.UserDefaultsApi.setDouble', codec,
binaryMessenger: binaryMessenger);
if (api == null) {
- channel.setMockMessageHandler(null);
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel, null);
} else {
- channel.setMockMessageHandler((Object? message) async {
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel,
+ (Object? message) async {
assert(message != null,
'Argument for dev.flutter.pigeon.UserDefaultsApi.setDouble was null.');
final List<Object?> args = (message as List<Object?>?)!;
@@ -98,9 +109,12 @@
'dev.flutter.pigeon.UserDefaultsApi.setValue', codec,
binaryMessenger: binaryMessenger);
if (api == null) {
- channel.setMockMessageHandler(null);
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel, null);
} else {
- channel.setMockMessageHandler((Object? message) async {
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel,
+ (Object? message) async {
assert(message != null,
'Argument for dev.flutter.pigeon.UserDefaultsApi.setValue was null.');
final List<Object?> args = (message as List<Object?>?)!;
@@ -120,9 +134,12 @@
'dev.flutter.pigeon.UserDefaultsApi.getAllWithPrefix', codec,
binaryMessenger: binaryMessenger);
if (api == null) {
- channel.setMockMessageHandler(null);
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel, null);
} else {
- channel.setMockMessageHandler((Object? message) async {
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel,
+ (Object? message) async {
assert(message != null,
'Argument for dev.flutter.pigeon.UserDefaultsApi.getAllWithPrefix was null.');
final List<Object?> args = (message as List<Object?>?)!;
@@ -140,9 +157,12 @@
'dev.flutter.pigeon.UserDefaultsApi.clearWithPrefix', codec,
binaryMessenger: binaryMessenger);
if (api == null) {
- channel.setMockMessageHandler(null);
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel, null);
} else {
- channel.setMockMessageHandler((Object? message) async {
+ _testBinaryMessengerBinding!.defaultBinaryMessenger
+ .setMockDecodedMessageHandler<Object?>(channel,
+ (Object? message) async {
assert(message != null,
'Argument for dev.flutter.pigeon.UserDefaultsApi.clearWithPrefix was null.');
final List<Object?> args = (message as List<Object?>?)!;