Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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/path_provider/path_provider_foundation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.2.1

* Updates to `pigeon` version 9.

## 2.2.0

* Adds support for `getContainerPath` on iOS.
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 (v5.0.1), do not edit directly.
// Autogenerated from Pigeon (v9.1.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon

import Foundation
Expand All @@ -14,7 +14,25 @@ import FlutterMacOS
#endif


/// Generated class from Pigeon.

private func wrapResult(_ result: Any?) -> [Any?] {
return [result]
}

private func wrapError(_ error: Any) -> [Any?] {
if let flutterError = error as? FlutterError {
return [
flutterError.code,
flutterError.message,
flutterError.details
]
}
return [
"\(error)",
"\(type(of: error))",
"Stacktrace: \(Thread.callStackSymbols)"
]
}

enum DirectoryType: Int {
case applicationDocuments = 0
Expand All @@ -25,8 +43,8 @@ enum DirectoryType: Int {
}
/// Generated protocol from Pigeon that represents a handler of messages from Flutter.
protocol PathProviderApi {
func getDirectoryPath(type: DirectoryType) -> String?
func getContainerPath(appGroupIdentifier: String) -> String?
func getDirectoryPath(type: DirectoryType) throws -> String?
func getContainerPath(appGroupIdentifier: String) throws -> String?
}

/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`.
Expand All @@ -37,36 +55,32 @@ class PathProviderApiSetup {
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)!
let result = api.getDirectoryPath(type: typeArg)
reply(wrapResult(result))
do {
let result = try api.getDirectoryPath(type: typeArg)
reply(wrapResult(result))
} catch {
reply(wrapError(error))
}
}
} else {
getDirectoryPathChannel.setMessageHandler(nil)
}
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
let result = api.getContainerPath(appGroupIdentifier: appGroupIdentifierArg)
reply(wrapResult(result))
do {
let result = try api.getContainerPath(appGroupIdentifier: appGroupIdentifierArg)
reply(wrapResult(result))
} catch {
reply(wrapError(error))
}
}
} else {
getContainerPathChannel.setMessageHandler(nil)
}
}
}

private func wrapResult(_ result: Any?) -> [Any?] {
return [result]
}

private func wrapError(_ error: FlutterError) -> [Any?] {
return [
error.code,
error.message,
error.details
]
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// 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 (v5.0.1), do not edit directly.
// Autogenerated from Pigeon (v9.1.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import

import 'dart:async';
import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List;

Expand Down
4 changes: 2 additions & 2 deletions packages/path_provider/path_provider_foundation/pubspec.yaml
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.0
version: 2.2.1

environment:
sdk: ">=2.17.0 <4.0.0"
Expand Down Expand Up @@ -32,4 +32,4 @@ dev_dependencies:
sdk: flutter
mockito: 5.3.2
path: ^1.8.0
pigeon: ^5.0.0
pigeon: ^9.1.0
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 (v5.0.1), do not edit directly.
// Autogenerated from Pigeon (v9.1.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import
// ignore_for_file: avoid_relative_lib_imports
Expand Down