Skip to content

Commit 3fec7e8

Browse files
[local_auth] Update Windows Pigeon version (#4388)
Updates to the latest version of Pigeon. This is largely a no-op, the generated output changes are formatting tweaks and picking up one bugfix to the error code/message ordering. The goal here is just to be using a newer version of Pigeon to minimize future dependency issues along the lines of #4383
1 parent 443e041 commit 3fec7e8

File tree

5 files changed

+48
-42
lines changed

5 files changed

+48
-42
lines changed

packages/local_auth/local_auth_windows/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
## NEXT
1+
## 1.0.9
22

3+
* Updates to Pigeon 10.0.
34
* Fixes stale ignore: prefer_const_constructors.
45
* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0.
56

packages/local_auth/local_auth_windows/lib/src/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 (v10.1.2), 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/local_auth/local_auth_windows/pubspec.yaml

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

77
environment:
88
sdk: ">=3.0.0 <4.0.0"
@@ -24,4 +24,4 @@ dependencies:
2424
dev_dependencies:
2525
flutter_test:
2626
sdk: flutter
27-
pigeon: ^5.0.1
27+
pigeon: ^10.1.2
Lines changed: 33 additions & 29 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 (v10.1.2), do not edit directly.
55
// See also: https://pub.dev/packages/pigeon
66

77
#undef _HAS_EXCEPTIONS
@@ -18,6 +18,12 @@
1818
#include <string>
1919

2020
namespace local_auth_windows {
21+
using flutter::BasicMessageChannel;
22+
using flutter::CustomEncodableValue;
23+
using flutter::EncodableList;
24+
using flutter::EncodableMap;
25+
using flutter::EncodableValue;
26+
2127
/// The codec used by LocalAuthApi.
2228
const flutter::StandardMessageCodec& LocalAuthApi::GetCodec() {
2329
return flutter::StandardMessageCodec::GetInstance(
@@ -29,24 +35,23 @@ const flutter::StandardMessageCodec& LocalAuthApi::GetCodec() {
2935
void LocalAuthApi::SetUp(flutter::BinaryMessenger* binary_messenger,
3036
LocalAuthApi* api) {
3137
{
32-
auto channel =
33-
std::make_unique<flutter::BasicMessageChannel<flutter::EncodableValue>>(
34-
binary_messenger,
35-
"dev.flutter.pigeon.LocalAuthApi.isDeviceSupported", &GetCodec());
38+
auto channel = std::make_unique<BasicMessageChannel<>>(
39+
binary_messenger, "dev.flutter.pigeon.LocalAuthApi.isDeviceSupported",
40+
&GetCodec());
3641
if (api != nullptr) {
3742
channel->SetMessageHandler(
38-
[api](const flutter::EncodableValue& message,
39-
const flutter::MessageReply<flutter::EncodableValue>& reply) {
43+
[api](const EncodableValue& message,
44+
const flutter::MessageReply<EncodableValue>& reply) {
4045
try {
4146
api->IsDeviceSupported([reply](ErrorOr<bool>&& output) {
4247
if (output.has_error()) {
4348
reply(WrapError(output.error()));
4449
return;
4550
}
46-
flutter::EncodableList wrapped;
51+
EncodableList wrapped;
4752
wrapped.push_back(
48-
flutter::EncodableValue(std::move(output).TakeValue()));
49-
reply(flutter::EncodableValue(std::move(wrapped)));
53+
EncodableValue(std::move(output).TakeValue()));
54+
reply(EncodableValue(std::move(wrapped)));
5055
});
5156
} catch (const std::exception& exception) {
5257
reply(WrapError(exception.what()));
@@ -57,16 +62,15 @@ void LocalAuthApi::SetUp(flutter::BinaryMessenger* binary_messenger,
5762
}
5863
}
5964
{
60-
auto channel =
61-
std::make_unique<flutter::BasicMessageChannel<flutter::EncodableValue>>(
62-
binary_messenger, "dev.flutter.pigeon.LocalAuthApi.authenticate",
63-
&GetCodec());
65+
auto channel = std::make_unique<BasicMessageChannel<>>(
66+
binary_messenger, "dev.flutter.pigeon.LocalAuthApi.authenticate",
67+
&GetCodec());
6468
if (api != nullptr) {
6569
channel->SetMessageHandler(
66-
[api](const flutter::EncodableValue& message,
67-
const flutter::MessageReply<flutter::EncodableValue>& reply) {
70+
[api](const EncodableValue& message,
71+
const flutter::MessageReply<EncodableValue>& reply) {
6872
try {
69-
const auto& args = std::get<flutter::EncodableList>(message);
73+
const auto& args = std::get<EncodableList>(message);
7074
const auto& encodable_localized_reason_arg = args.at(0);
7175
if (encodable_localized_reason_arg.IsNull()) {
7276
reply(WrapError("localized_reason_arg unexpectedly null."));
@@ -80,10 +84,10 @@ void LocalAuthApi::SetUp(flutter::BinaryMessenger* binary_messenger,
8084
reply(WrapError(output.error()));
8185
return;
8286
}
83-
flutter::EncodableList wrapped;
87+
EncodableList wrapped;
8488
wrapped.push_back(
85-
flutter::EncodableValue(std::move(output).TakeValue()));
86-
reply(flutter::EncodableValue(std::move(wrapped)));
89+
EncodableValue(std::move(output).TakeValue()));
90+
reply(EncodableValue(std::move(wrapped)));
8791
});
8892
} catch (const std::exception& exception) {
8993
reply(WrapError(exception.what()));
@@ -95,16 +99,16 @@ void LocalAuthApi::SetUp(flutter::BinaryMessenger* binary_messenger,
9599
}
96100
}
97101

98-
flutter::EncodableValue LocalAuthApi::WrapError(
99-
std::string_view error_message) {
100-
return flutter::EncodableValue(flutter::EncodableList{
101-
flutter::EncodableValue(std::string(error_message)),
102-
flutter::EncodableValue("Error"), flutter::EncodableValue()});
102+
EncodableValue LocalAuthApi::WrapError(std::string_view error_message) {
103+
return EncodableValue(
104+
EncodableList{EncodableValue(std::string(error_message)),
105+
EncodableValue("Error"), EncodableValue()});
103106
}
104-
flutter::EncodableValue LocalAuthApi::WrapError(const FlutterError& error) {
105-
return flutter::EncodableValue(flutter::EncodableList{
106-
flutter::EncodableValue(error.message()),
107-
flutter::EncodableValue(error.code()), error.details()});
107+
108+
EncodableValue LocalAuthApi::WrapError(const FlutterError& error) {
109+
return EncodableValue(EncodableList{EncodableValue(error.code()),
110+
EncodableValue(error.message()),
111+
error.details()});
108112
}
109113

110114
} // namespace local_auth_windows

packages/local_auth/local_auth_windows/windows/messages.g.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
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 (v10.1.2), do not edit directly.
55
// See also: https://pub.dev/packages/pigeon
66

7-
#ifndef PIGEON_LOCAL_AUTH_WINDOWS_H_
8-
#define PIGEON_LOCAL_AUTH_WINDOWS_H_
7+
#ifndef PIGEON_MESSAGES_G_H_
8+
#define PIGEON_MESSAGES_G_H_
99
#include <flutter/basic_message_channel.h>
1010
#include <flutter/binary_messenger.h>
1111
#include <flutter/encodable_value.h>
@@ -41,10 +41,10 @@ class FlutterError {
4141
template <class T>
4242
class ErrorOr {
4343
public:
44-
ErrorOr(const T& rhs) { new (&v_) T(rhs); }
45-
ErrorOr(const T&& rhs) { v_ = std::move(rhs); }
46-
ErrorOr(const FlutterError& rhs) { new (&v_) FlutterError(rhs); }
47-
ErrorOr(const FlutterError&& rhs) { v_ = std::move(rhs); }
44+
ErrorOr(const T& rhs) : v_(rhs) {}
45+
ErrorOr(const T&& rhs) : v_(std::move(rhs)) {}
46+
ErrorOr(const FlutterError& rhs) : v_(rhs) {}
47+
ErrorOr(const FlutterError&& rhs) : v_(std::move(rhs)) {}
4848

4949
bool has_error() const { return std::holds_alternative<FlutterError>(v_); }
5050
const T& value() const { return std::get<T>(v_); };
@@ -64,7 +64,7 @@ class LocalAuthApi {
6464
public:
6565
LocalAuthApi(const LocalAuthApi&) = delete;
6666
LocalAuthApi& operator=(const LocalAuthApi&) = delete;
67-
virtual ~LocalAuthApi(){};
67+
virtual ~LocalAuthApi() {}
6868
// Returns true if this device supports authentication.
6969
virtual void IsDeviceSupported(
7070
std::function<void(ErrorOr<bool> reply)> result) = 0;
@@ -90,4 +90,4 @@ class LocalAuthApi {
9090
LocalAuthApi() = default;
9191
};
9292
} // namespace local_auth_windows
93-
#endif // PIGEON_LOCAL_AUTH_WINDOWS_H_
93+
#endif // PIGEON_MESSAGES_G_H_

0 commit comments

Comments
 (0)