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

[various] Update Pigeon in Swift plugins #4461

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/file_selector/file_selector_macos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.9.3+1

* Updates to the latest version of `pigeon`.

## 0.9.3

* Adds `getSaveLocation` and deprecates `getSavePath`.
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 (v9.2.4), do not edit directly.
// Autogenerated from Pigeon (v10.1.3), 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

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 (v9.2.4), do not edit directly.
// Autogenerated from Pigeon (v10.1.3), do not edit directly.
// See also: https://pub.dev/packages/pigeon

import Foundation
Expand Down Expand Up @@ -35,7 +35,7 @@ private func wrapError(_ error: Any) -> [Any?] {

private func nilOrValue<T>(_ value: Any?) -> T? {
if value is NSNull { return nil }
return (value as Any) as! T?
return value as! T?
}

/// A Pigeon representation of the macOS portion of an `XTypeGroup`.
Expand All @@ -46,7 +46,7 @@ struct AllowedTypes {
var mimeTypes: [String?]
var utis: [String?]

static func fromList(_ list: [Any]) -> AllowedTypes? {
static func fromList(_ list: [Any?]) -> AllowedTypes? {
let extensions = list[0] as! [String?]
let mimeTypes = list[1] as! [String?]
let utis = list[2] as! [String?]
Expand Down Expand Up @@ -78,9 +78,9 @@ struct SavePanelOptions {
var nameFieldStringValue: String? = nil
var prompt: String? = nil

static func fromList(_ list: [Any]) -> SavePanelOptions? {
static func fromList(_ list: [Any?]) -> SavePanelOptions? {
var allowedFileTypes: AllowedTypes? = nil
if let allowedFileTypesList = list[0] as! [Any]? {
if let allowedFileTypesList: [Any?] = nilOrValue(list[0]) {
allowedFileTypes = AllowedTypes.fromList(allowedFileTypesList)
}
let directoryPath: String? = nilOrValue(list[1])
Expand Down Expand Up @@ -115,11 +115,11 @@ struct OpenPanelOptions {
var canChooseFiles: Bool
var baseOptions: SavePanelOptions

static func fromList(_ list: [Any]) -> OpenPanelOptions? {
static func fromList(_ list: [Any?]) -> OpenPanelOptions? {
let allowsMultipleSelection = list[0] as! Bool
let canChooseDirectories = list[1] as! Bool
let canChooseFiles = list[2] as! Bool
let baseOptions = SavePanelOptions.fromList(list[3] as! [Any])!
let baseOptions = SavePanelOptions.fromList(list[3] as! [Any?])!

return OpenPanelOptions(
allowsMultipleSelection: allowsMultipleSelection,
Expand All @@ -142,11 +142,11 @@ private class FileSelectorApiCodecReader: FlutterStandardReader {
override func readValue(ofType type: UInt8) -> Any? {
switch type {
case 128:
return AllowedTypes.fromList(self.readValue() as! [Any])
return AllowedTypes.fromList(self.readValue() as! [Any?])
case 129:
return OpenPanelOptions.fromList(self.readValue() as! [Any])
return OpenPanelOptions.fromList(self.readValue() as! [Any?])
case 130:
return SavePanelOptions.fromList(self.readValue() as! [Any])
return SavePanelOptions.fromList(self.readValue() as! [Any?])
default:
return super.readValue(ofType: type)
}
Expand Down Expand Up @@ -214,7 +214,7 @@ class FileSelectorApiSetup {
codec: codec)
if let api = api {
displayOpenPanelChannel.setMessageHandler { message, reply in
let args = message as! [Any]
let args = message as! [Any?]
let optionsArg = args[0] as! OpenPanelOptions
api.displayOpenPanel(options: optionsArg) { result in
switch result {
Expand All @@ -236,7 +236,7 @@ class FileSelectorApiSetup {
codec: codec)
if let api = api {
displaySavePanelChannel.setMessageHandler { message, reply in
let args = message as! [Any]
let args = message as! [Any?]
let optionsArg = args[0] as! SavePanelOptions
api.displaySavePanel(options: optionsArg) { result in
switch result {
Expand Down
4 changes: 2 additions & 2 deletions packages/file_selector/file_selector_macos/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: file_selector_macos
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.3
version: 0.9.3+1

environment:
sdk: ">=2.18.0 <4.0.0"
Expand All @@ -27,4 +27,4 @@ dev_dependencies:
flutter_test:
sdk: flutter
mockito: 5.4.1
pigeon: ^9.2.4
pigeon: ^10.1.3
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 (v9.2.4), do not edit directly.
// Autogenerated from Pigeon (v10.1.3), 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 2.2.4

* Updates to the latest version of `pigeon`.
* Updates minimum supported macOS version to 10.14.

## 2.2.3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
// 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.2.4), do not edit directly.
// Autogenerated from Pigeon (v10.1.3), do not edit directly.
// See also: https://pub.dev/packages/pigeon

import Foundation

#if os(iOS)
import Flutter
import Flutter
#elseif os(macOS)
import FlutterMacOS
import FlutterMacOS
#else
#error("Unsupported platform.")
#error("Unsupported platform.")
#endif

private func wrapResult(_ result: Any?) -> [Any?] {
Expand All @@ -22,19 +23,19 @@ private func wrapError(_ error: Any) -> [Any?] {
return [
flutterError.code,
flutterError.message,
flutterError.details
flutterError.details,
]
}
return [
"\(error)",
"\(type(of: error))",
"Stacktrace: \(Thread.callStackSymbols)"
"Stacktrace: \(Thread.callStackSymbols)",
]
}

private func nilOrValue<T>(_ value: Any?) -> T? {
if value is NSNull { return nil }
return (value as Any) as! T?
return value as! T?
}

enum DirectoryType: Int {
Expand All @@ -55,10 +56,11 @@ class PathProviderApiSetup {
/// The codec used by PathProviderApi.
/// Sets up an instance of `PathProviderApi` to handle messages through the `binaryMessenger`.
static func setUp(binaryMessenger: FlutterBinaryMessenger, api: PathProviderApi?) {
let getDirectoryPathChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.PathProviderApi.getDirectoryPath", binaryMessenger: binaryMessenger)
let getDirectoryPathChannel = FlutterBasicMessageChannel(
name: "dev.flutter.pigeon.PathProviderApi.getDirectoryPath", binaryMessenger: binaryMessenger)
if let api = api {
getDirectoryPathChannel.setMessageHandler { message, reply in
let args = message as! [Any]
let args = message as! [Any?]
let typeArg = DirectoryType(rawValue: args[0] as! Int)!
do {
let result = try api.getDirectoryPath(type: typeArg)
Expand All @@ -70,10 +72,11 @@ class PathProviderApiSetup {
} else {
getDirectoryPathChannel.setMessageHandler(nil)
}
let getContainerPathChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.PathProviderApi.getContainerPath", binaryMessenger: binaryMessenger)
let getContainerPathChannel = FlutterBasicMessageChannel(
name: "dev.flutter.pigeon.PathProviderApi.getContainerPath", binaryMessenger: binaryMessenger)
if let api = api {
getContainerPathChannel.setMessageHandler { message, reply in
let args = message as! [Any]
let args = message as! [Any?]
let appGroupIdentifierArg = args[0] as! String
do {
let result = try api.getContainerPath(appGroupIdentifier: appGroupIdentifierArg)
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 (v9.2.4), do not edit directly.
// Autogenerated from Pigeon (v10.1.3), 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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: path_provider_foundation
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.3
version: 2.2.4

environment:
sdk: ">=2.18.0 <4.0.0"
Expand Down Expand Up @@ -32,4 +32,4 @@ dev_dependencies:
sdk: flutter
mockito: 5.4.1
path: ^1.8.0
pigeon: ^9.2.4
pigeon: ^10.1.3
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 (v9.2.4), do not edit directly.
// Autogenerated from Pigeon (v10.1.3), 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.3.2

* Updates to the latest version of `pigeon`.

## 2.3.1

* Fixes variable binding bug on older versions of Xcode.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
// 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.2.5), do not edit directly.
// Autogenerated from Pigeon (v10.1.3), do not edit directly.
// See also: https://pub.dev/packages/pigeon

import Foundation

#if os(iOS)
import Flutter
import Flutter
#elseif os(macOS)
import FlutterMacOS
import FlutterMacOS
#else
#error("Unsupported platform.")
#error("Unsupported platform.")
#endif

private func wrapResult(_ result: Any?) -> [Any?] {
Expand All @@ -22,19 +23,19 @@ private func wrapError(_ error: Any) -> [Any?] {
return [
flutterError.code,
flutterError.message,
flutterError.details
flutterError.details,
]
}
return [
"\(error)",
"\(type(of: error))",
"Stacktrace: \(Thread.callStackSymbols)"
"Stacktrace: \(Thread.callStackSymbols)",
]
}

private func nilOrValue<T>(_ value: Any?) -> T? {
if value is NSNull { return nil }
return (value as Any) as! T?
return value as! T?
}
/// Generated protocol from Pigeon that represents a handler of messages from Flutter.
protocol UserDefaultsApi {
Expand All @@ -51,10 +52,11 @@ class UserDefaultsApiSetup {
/// The codec used by UserDefaultsApi.
/// Sets up an instance of `UserDefaultsApi` to handle messages through the `binaryMessenger`.
static func setUp(binaryMessenger: FlutterBinaryMessenger, api: UserDefaultsApi?) {
let removeChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.UserDefaultsApi.remove", binaryMessenger: binaryMessenger)
let removeChannel = FlutterBasicMessageChannel(
name: "dev.flutter.pigeon.UserDefaultsApi.remove", binaryMessenger: binaryMessenger)
if let api = api {
removeChannel.setMessageHandler { message, reply in
let args = message as! [Any]
let args = message as! [Any?]
let keyArg = args[0] as! String
do {
try api.remove(key: keyArg)
Expand All @@ -66,10 +68,11 @@ class UserDefaultsApiSetup {
} else {
removeChannel.setMessageHandler(nil)
}
let setBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.UserDefaultsApi.setBool", binaryMessenger: binaryMessenger)
let setBoolChannel = FlutterBasicMessageChannel(
name: "dev.flutter.pigeon.UserDefaultsApi.setBool", binaryMessenger: binaryMessenger)
if let api = api {
setBoolChannel.setMessageHandler { message, reply in
let args = message as! [Any]
let args = message as! [Any?]
let keyArg = args[0] as! String
let valueArg = args[1] as! Bool
do {
Expand All @@ -82,10 +85,11 @@ class UserDefaultsApiSetup {
} else {
setBoolChannel.setMessageHandler(nil)
}
let setDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.UserDefaultsApi.setDouble", binaryMessenger: binaryMessenger)
let setDoubleChannel = FlutterBasicMessageChannel(
name: "dev.flutter.pigeon.UserDefaultsApi.setDouble", binaryMessenger: binaryMessenger)
if let api = api {
setDoubleChannel.setMessageHandler { message, reply in
let args = message as! [Any]
let args = message as! [Any?]
let keyArg = args[0] as! String
let valueArg = args[1] as! Double
do {
Expand All @@ -98,12 +102,13 @@ class UserDefaultsApiSetup {
} else {
setDoubleChannel.setMessageHandler(nil)
}
let setValueChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.UserDefaultsApi.setValue", binaryMessenger: binaryMessenger)
let setValueChannel = FlutterBasicMessageChannel(
name: "dev.flutter.pigeon.UserDefaultsApi.setValue", binaryMessenger: binaryMessenger)
if let api = api {
setValueChannel.setMessageHandler { message, reply in
let args = message as! [Any]
let args = message as! [Any?]
let keyArg = args[0] as! String
let valueArg = args[1]
let valueArg = args[1]!
do {
try api.setValue(key: keyArg, value: valueArg)
reply(wrapResult(nil))
Expand All @@ -114,10 +119,11 @@ class UserDefaultsApiSetup {
} else {
setValueChannel.setMessageHandler(nil)
}
let getAllChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.UserDefaultsApi.getAll", binaryMessenger: binaryMessenger)
let getAllChannel = FlutterBasicMessageChannel(
name: "dev.flutter.pigeon.UserDefaultsApi.getAll", binaryMessenger: binaryMessenger)
if let api = api {
getAllChannel.setMessageHandler { message, reply in
let args = message as! [Any]
let args = message as! [Any?]
let prefixArg = args[0] as! String
let allowListArg: [String]? = nilOrValue(args[1])
do {
Expand All @@ -130,10 +136,11 @@ class UserDefaultsApiSetup {
} else {
getAllChannel.setMessageHandler(nil)
}
let clearChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.UserDefaultsApi.clear", binaryMessenger: binaryMessenger)
let clearChannel = FlutterBasicMessageChannel(
name: "dev.flutter.pigeon.UserDefaultsApi.clear", binaryMessenger: binaryMessenger)
if let api = api {
clearChannel.setMessageHandler { message, reply in
let args = message as! [Any]
let args = message as! [Any?]
let prefixArg = args[0] as! String
let allowListArg: [String]? = nilOrValue(args[1])
do {
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 (v9.2.5), do not edit directly.
// Autogenerated from Pigeon (v10.1.3), 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

Expand Down
Loading