From ef6b1e37864a787d88081e7b98620d29530294a7 Mon Sep 17 00:00:00 2001 From: Robert Schulze Dieckhoff Date: Wed, 5 Feb 2025 14:23:03 +0100 Subject: [PATCH] Moved generated pigeon code for iOS into a dedicated folder --- CHANGELOG.md | 6 ++++ ios/Classes/{ => generated}/PlatformApi.swift | 34 +++++++++---------- pigeons/platform_api.dart | 4 +-- 3 files changed, 25 insertions(+), 19 deletions(-) rename ios/Classes/{ => generated}/PlatformApi.swift (98%) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7a43149..db03d25e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.4.0 + +### New + +- Set minimum SDK version to Flutter 3.16/Dart 3.2 + ## 1.3.0 ### New diff --git a/ios/Classes/PlatformApi.swift b/ios/Classes/generated/PlatformApi.swift similarity index 98% rename from ios/Classes/PlatformApi.swift rename to ios/Classes/generated/PlatformApi.swift index 529b13b9..350d946c 100644 --- a/ios/Classes/PlatformApi.swift +++ b/ios/Classes/generated/PlatformApi.swift @@ -12,7 +12,7 @@ import Foundation #endif /// Error class for passing custom error details to Dart side. -final class PigeonError: Error { +final class AdyenPigeonError: Error { let code: String let message: String? let details: Any? @@ -25,7 +25,7 @@ final class PigeonError: Error { var localizedDescription: String { return - "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" + "AdyenPigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" } } @@ -34,7 +34,7 @@ private func wrapResult(_ result: Any?) -> [Any?] { } private func wrapError(_ error: Any) -> [Any?] { - if let pigeonError = error as? PigeonError { + if let pigeonError = error as? AdyenPigeonError { return [ pigeonError.code, pigeonError.message, @@ -55,8 +55,8 @@ private func wrapError(_ error: Any) -> [Any?] { ] } -private func createConnectionError(withChannelName channelName: String) -> PigeonError { - return PigeonError(code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", details: "") +private func createConnectionError(withChannelName channelName: String) -> AdyenPigeonError { + return AdyenPigeonError(code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", details: "") } private func isNullish(_ value: Any?) -> Bool { @@ -1912,8 +1912,8 @@ class DropInPlatformInterfaceSetup { } /// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. protocol DropInFlutterInterfaceProtocol { - func onDropInSessionPlatformCommunication(platformCommunicationModel platformCommunicationModelArg: PlatformCommunicationModel, completion: @escaping (Result) -> Void) - func onDropInAdvancedPlatformCommunication(platformCommunicationModel platformCommunicationModelArg: PlatformCommunicationModel, completion: @escaping (Result) -> Void) + func onDropInSessionPlatformCommunication(platformCommunicationModel platformCommunicationModelArg: PlatformCommunicationModel, completion: @escaping (Result) -> Void) + func onDropInAdvancedPlatformCommunication(platformCommunicationModel platformCommunicationModelArg: PlatformCommunicationModel, completion: @escaping (Result) -> Void) } class DropInFlutterInterface: DropInFlutterInterfaceProtocol { private let binaryMessenger: FlutterBinaryMessenger @@ -1925,7 +1925,7 @@ class DropInFlutterInterface: DropInFlutterInterfaceProtocol { var codec: PlatformApiPigeonCodec { return PlatformApiPigeonCodec.shared } - func onDropInSessionPlatformCommunication(platformCommunicationModel platformCommunicationModelArg: PlatformCommunicationModel, completion: @escaping (Result) -> Void) { + func onDropInSessionPlatformCommunication(platformCommunicationModel platformCommunicationModelArg: PlatformCommunicationModel, completion: @escaping (Result) -> Void) { let channelName: String = "dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInSessionPlatformCommunication\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([platformCommunicationModelArg] as [Any?]) { response in @@ -1937,13 +1937,13 @@ class DropInFlutterInterface: DropInFlutterInterfaceProtocol { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) + completion(.failure(AdyenPigeonError(code: code, message: message, details: details))) } else { completion(.success(Void())) } } } - func onDropInAdvancedPlatformCommunication(platformCommunicationModel platformCommunicationModelArg: PlatformCommunicationModel, completion: @escaping (Result) -> Void) { + func onDropInAdvancedPlatformCommunication(platformCommunicationModel platformCommunicationModelArg: PlatformCommunicationModel, completion: @escaping (Result) -> Void) { let channelName: String = "dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInAdvancedPlatformCommunication\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([platformCommunicationModelArg] as [Any?]) { response in @@ -1955,7 +1955,7 @@ class DropInFlutterInterface: DropInFlutterInterfaceProtocol { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) + completion(.failure(AdyenPigeonError(code: code, message: message, details: details))) } else { completion(.success(Void())) } @@ -2098,8 +2098,8 @@ class ComponentPlatformInterfaceSetup { } /// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. protocol ComponentFlutterInterfaceProtocol { - func _generateCodecForDTOs(cardComponentConfigurationDTO cardComponentConfigurationDTOArg: CardComponentConfigurationDTO, sessionDTO sessionDTOArg: SessionDTO, completion: @escaping (Result) -> Void) - func onComponentCommunication(componentCommunicationModel componentCommunicationModelArg: ComponentCommunicationModel, completion: @escaping (Result) -> Void) + func _generateCodecForDTOs(cardComponentConfigurationDTO cardComponentConfigurationDTOArg: CardComponentConfigurationDTO, sessionDTO sessionDTOArg: SessionDTO, completion: @escaping (Result) -> Void) + func onComponentCommunication(componentCommunicationModel componentCommunicationModelArg: ComponentCommunicationModel, completion: @escaping (Result) -> Void) } class ComponentFlutterInterface: ComponentFlutterInterfaceProtocol { private let binaryMessenger: FlutterBinaryMessenger @@ -2111,7 +2111,7 @@ class ComponentFlutterInterface: ComponentFlutterInterfaceProtocol { var codec: PlatformApiPigeonCodec { return PlatformApiPigeonCodec.shared } - func _generateCodecForDTOs(cardComponentConfigurationDTO cardComponentConfigurationDTOArg: CardComponentConfigurationDTO, sessionDTO sessionDTOArg: SessionDTO, completion: @escaping (Result) -> Void) { + func _generateCodecForDTOs(cardComponentConfigurationDTO cardComponentConfigurationDTOArg: CardComponentConfigurationDTO, sessionDTO sessionDTOArg: SessionDTO, completion: @escaping (Result) -> Void) { let channelName: String = "dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface._generateCodecForDTOs\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([cardComponentConfigurationDTOArg, sessionDTOArg] as [Any?]) { response in @@ -2123,13 +2123,13 @@ class ComponentFlutterInterface: ComponentFlutterInterfaceProtocol { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) + completion(.failure(AdyenPigeonError(code: code, message: message, details: details))) } else { completion(.success(Void())) } } } - func onComponentCommunication(componentCommunicationModel componentCommunicationModelArg: ComponentCommunicationModel, completion: @escaping (Result) -> Void) { + func onComponentCommunication(componentCommunicationModel componentCommunicationModelArg: ComponentCommunicationModel, completion: @escaping (Result) -> Void) { let channelName: String = "dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface.onComponentCommunication\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([componentCommunicationModelArg] as [Any?]) { response in @@ -2141,7 +2141,7 @@ class ComponentFlutterInterface: ComponentFlutterInterfaceProtocol { let code: String = listResponse[0] as! String let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) + completion(.failure(AdyenPigeonError(code: code, message: message, details: details))) } else { completion(.success(Void())) } diff --git a/pigeons/platform_api.dart b/pigeons/platform_api.dart index c43f9d15..175cd954 100644 --- a/pigeons/platform_api.dart +++ b/pigeons/platform_api.dart @@ -10,8 +10,8 @@ import 'package:pigeon/pigeon.dart'; package: "com.adyen.checkout.flutter.generated", errorClassName: "AdyenPigeonError", ), - swiftOut: 'ios/Classes/PlatformApi.swift', - swiftOptions: SwiftOptions(), + swiftOut: 'ios/Classes/generated/PlatformApi.swift', + swiftOptions: SwiftOptions(errorClassName: "AdyenPigeonError"), dartPackageName: 'adyen_checkout', )) enum Environment {