Skip to content

Commit b4e12f0

Browse files
authored
Update path_provider_foundation to latest pigeon (#3564)
Update path_provider_foundation to latest pigeon
1 parent f14934c commit b4e12f0

File tree

5 files changed

+45
-26
lines changed

5 files changed

+45
-26
lines changed

packages/path_provider/path_provider_foundation/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.2.1
2+
3+
* Updates to `pigeon` version 9.
4+
15
## 2.2.0
26

37
* Adds support for `getContainerPath` on iOS.

packages/path_provider/path_provider_foundation/darwin/Classes/messages.g.swift

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2013 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
4-
// Autogenerated from Pigeon (v5.0.1), do not edit directly.
4+
// Autogenerated from Pigeon (v9.1.1), do not edit directly.
55
// See also: https://pub.dev/packages/pigeon
66

77
import Foundation
@@ -14,7 +14,25 @@ import FlutterMacOS
1414
#endif
1515

1616

17-
/// Generated class from Pigeon.
17+
18+
private func wrapResult(_ result: Any?) -> [Any?] {
19+
return [result]
20+
}
21+
22+
private func wrapError(_ error: Any) -> [Any?] {
23+
if let flutterError = error as? FlutterError {
24+
return [
25+
flutterError.code,
26+
flutterError.message,
27+
flutterError.details
28+
]
29+
}
30+
return [
31+
"\(error)",
32+
"\(type(of: error))",
33+
"Stacktrace: \(Thread.callStackSymbols)"
34+
]
35+
}
1836

1937
enum DirectoryType: Int {
2038
case applicationDocuments = 0
@@ -25,8 +43,8 @@ enum DirectoryType: Int {
2543
}
2644
/// Generated protocol from Pigeon that represents a handler of messages from Flutter.
2745
protocol PathProviderApi {
28-
func getDirectoryPath(type: DirectoryType) -> String?
29-
func getContainerPath(appGroupIdentifier: String) -> String?
46+
func getDirectoryPath(type: DirectoryType) throws -> String?
47+
func getContainerPath(appGroupIdentifier: String) throws -> String?
3048
}
3149

3250
/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`.
@@ -37,36 +55,32 @@ class PathProviderApiSetup {
3755
let getDirectoryPathChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.PathProviderApi.getDirectoryPath", binaryMessenger: binaryMessenger)
3856
if let api = api {
3957
getDirectoryPathChannel.setMessageHandler { message, reply in
40-
let args = message as! [Any?]
58+
let args = message as! [Any]
4159
let typeArg = DirectoryType(rawValue: args[0] as! Int)!
42-
let result = api.getDirectoryPath(type: typeArg)
43-
reply(wrapResult(result))
60+
do {
61+
let result = try api.getDirectoryPath(type: typeArg)
62+
reply(wrapResult(result))
63+
} catch {
64+
reply(wrapError(error))
65+
}
4466
}
4567
} else {
4668
getDirectoryPathChannel.setMessageHandler(nil)
4769
}
4870
let getContainerPathChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.PathProviderApi.getContainerPath", binaryMessenger: binaryMessenger)
4971
if let api = api {
5072
getContainerPathChannel.setMessageHandler { message, reply in
51-
let args = message as! [Any?]
73+
let args = message as! [Any]
5274
let appGroupIdentifierArg = args[0] as! String
53-
let result = api.getContainerPath(appGroupIdentifier: appGroupIdentifierArg)
54-
reply(wrapResult(result))
75+
do {
76+
let result = try api.getContainerPath(appGroupIdentifier: appGroupIdentifierArg)
77+
reply(wrapResult(result))
78+
} catch {
79+
reply(wrapError(error))
80+
}
5581
}
5682
} else {
5783
getContainerPathChannel.setMessageHandler(nil)
5884
}
5985
}
6086
}
61-
62-
private func wrapResult(_ result: Any?) -> [Any?] {
63-
return [result]
64-
}
65-
66-
private func wrapError(_ error: FlutterError) -> [Any?] {
67-
return [
68-
error.code,
69-
error.message,
70-
error.details
71-
]
72-
}

packages/path_provider/path_provider_foundation/lib/messages.g.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// Copyright 2013 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
4-
// Autogenerated from Pigeon (v5.0.1), do not edit directly.
4+
// Autogenerated from Pigeon (v9.1.1), do not edit directly.
55
// See also: https://pub.dev/packages/pigeon
66
// 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
7+
78
import 'dart:async';
89
import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List;
910

packages/path_provider/path_provider_foundation/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: path_provider_foundation
22
description: iOS and macOS implementation of the path_provider plugin
33
repository: https://github.com/flutter/packages/tree/main/packages/path_provider/path_provider_foundation
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+path_provider%22
5-
version: 2.2.0
5+
version: 2.2.1
66

77
environment:
88
sdk: ">=2.17.0 <4.0.0"
@@ -32,4 +32,4 @@ dev_dependencies:
3232
sdk: flutter
3333
mockito: 5.3.2
3434
path: ^1.8.0
35-
pigeon: ^5.0.0
35+
pigeon: ^9.1.0

packages/path_provider/path_provider_foundation/test/messages_test.g.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2013 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
4-
// Autogenerated from Pigeon (v5.0.1), do not edit directly.
4+
// Autogenerated from Pigeon (v9.1.1), do not edit directly.
55
// See also: https://pub.dev/packages/pigeon
66
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import
77
// ignore_for_file: avoid_relative_lib_imports

0 commit comments

Comments
 (0)