1
1
// Copyright 2013 The Flutter Authors
2
2
// Use of this source code is governed by a BSD-style license that can be
3
3
// found in the LICENSE file.
4
- // Autogenerated from Pigeon (v22.6.2 ), do not edit directly.
4
+ // Autogenerated from Pigeon (v26.0.1 ), do not edit directly.
5
5
// See also: https://pub.dev/packages/pigeon
6
6
// 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, no_leading_underscores_for_local_identifiers
7
7
@@ -18,6 +18,24 @@ PlatformException _createConnectionError(String channelName) {
18
18
);
19
19
}
20
20
21
+ bool _deepEquals (Object ? a, Object ? b) {
22
+ if (a is List && b is List ) {
23
+ return a.length == b.length &&
24
+ a.indexed.every (
25
+ ((int , dynamic ) item) => _deepEquals (item.$2, b[item.$1]),
26
+ );
27
+ }
28
+ if (a is Map && b is Map ) {
29
+ return a.length == b.length &&
30
+ a.entries.every (
31
+ (MapEntry <Object ?, Object ?> entry) =>
32
+ (b as Map <Object ?, Object ?>).containsKey (entry.key) &&
33
+ _deepEquals (entry.value, b[entry.key]),
34
+ );
35
+ }
36
+ return a == b;
37
+ }
38
+
21
39
enum FileSelectorExceptionCode {
22
40
securityException,
23
41
ioException,
@@ -35,17 +53,38 @@ class FileSelectorNativeException {
35
53
36
54
String message;
37
55
38
- Object encode () {
56
+ List < Object ?> _toList () {
39
57
return < Object ? > [fileSelectorExceptionCode, message];
40
58
}
41
59
60
+ Object encode () {
61
+ return _toList ();
62
+ }
63
+
42
64
static FileSelectorNativeException decode (Object result) {
43
65
result as List <Object ?>;
44
66
return FileSelectorNativeException (
45
67
fileSelectorExceptionCode: result[0 ]! as FileSelectorExceptionCode ,
46
68
message: result[1 ]! as String ,
47
69
);
48
70
}
71
+
72
+ @override
73
+ // ignore: avoid_equals_and_hash_code_on_mutable_classes
74
+ bool operator == (Object other) {
75
+ if (other is ! FileSelectorNativeException ||
76
+ other.runtimeType != runtimeType) {
77
+ return false ;
78
+ }
79
+ if (identical (this , other)) {
80
+ return true ;
81
+ }
82
+ return _deepEquals (encode (), other.encode ());
83
+ }
84
+
85
+ @override
86
+ // ignore: avoid_equals_and_hash_code_on_mutable_classes
87
+ int get hashCode => Object .hashAll (_toList ());
49
88
}
50
89
51
90
class FileResponse {
@@ -70,7 +109,7 @@ class FileResponse {
70
109
71
110
FileSelectorNativeException ? fileSelectorNativeException;
72
111
73
- Object encode () {
112
+ List < Object ?> _toList () {
74
113
return < Object ? > [
75
114
path,
76
115
mimeType,
@@ -81,6 +120,10 @@ class FileResponse {
81
120
];
82
121
}
83
122
123
+ Object encode () {
124
+ return _toList ();
125
+ }
126
+
84
127
static FileResponse decode (Object result) {
85
128
result as List <Object ?>;
86
129
return FileResponse (
@@ -92,6 +135,22 @@ class FileResponse {
92
135
fileSelectorNativeException: result[5 ] as FileSelectorNativeException ? ,
93
136
);
94
137
}
138
+
139
+ @override
140
+ // ignore: avoid_equals_and_hash_code_on_mutable_classes
141
+ bool operator == (Object other) {
142
+ if (other is ! FileResponse || other.runtimeType != runtimeType) {
143
+ return false ;
144
+ }
145
+ if (identical (this , other)) {
146
+ return true ;
147
+ }
148
+ return _deepEquals (encode (), other.encode ());
149
+ }
150
+
151
+ @override
152
+ // ignore: avoid_equals_and_hash_code_on_mutable_classes
153
+ int get hashCode => Object .hashAll (_toList ());
95
154
}
96
155
97
156
class FileTypes {
@@ -101,17 +160,37 @@ class FileTypes {
101
160
102
161
List <String > extensions;
103
162
104
- Object encode () {
163
+ List < Object ?> _toList () {
105
164
return < Object ? > [mimeTypes, extensions];
106
165
}
107
166
167
+ Object encode () {
168
+ return _toList ();
169
+ }
170
+
108
171
static FileTypes decode (Object result) {
109
172
result as List <Object ?>;
110
173
return FileTypes (
111
174
mimeTypes: (result[0 ] as List <Object ?>? )! .cast <String >(),
112
175
extensions: (result[1 ] as List <Object ?>? )! .cast <String >(),
113
176
);
114
177
}
178
+
179
+ @override
180
+ // ignore: avoid_equals_and_hash_code_on_mutable_classes
181
+ bool operator == (Object other) {
182
+ if (other is ! FileTypes || other.runtimeType != runtimeType) {
183
+ return false ;
184
+ }
185
+ if (identical (this , other)) {
186
+ return true ;
187
+ }
188
+ return _deepEquals (encode (), other.encode ());
189
+ }
190
+
191
+ @override
192
+ // ignore: avoid_equals_and_hash_code_on_mutable_classes
193
+ int get hashCode => Object .hashAll (_toList ());
115
194
}
116
195
117
196
class _PigeonCodec extends StandardMessageCodec {
@@ -188,9 +267,11 @@ class FileSelectorApi {
188
267
pigeonChannelCodec,
189
268
binaryMessenger: pigeonVar_binaryMessenger,
190
269
);
270
+ final Future <Object ?> pigeonVar_sendFuture = pigeonVar_channel.send (
271
+ < Object ? > [initialDirectory, allowedTypes],
272
+ );
191
273
final List <Object ?>? pigeonVar_replyList =
192
- await pigeonVar_channel.send (< Object ? > [initialDirectory, allowedTypes])
193
- as List <Object ?>? ;
274
+ await pigeonVar_sendFuture as List <Object ?>? ;
194
275
if (pigeonVar_replyList == null ) {
195
276
throw _createConnectionError (pigeonVar_channelName);
196
277
} else if (pigeonVar_replyList.length > 1 ) {
@@ -218,9 +299,11 @@ class FileSelectorApi {
218
299
pigeonChannelCodec,
219
300
binaryMessenger: pigeonVar_binaryMessenger,
220
301
);
302
+ final Future <Object ?> pigeonVar_sendFuture = pigeonVar_channel.send (
303
+ < Object ? > [initialDirectory, allowedTypes],
304
+ );
221
305
final List <Object ?>? pigeonVar_replyList =
222
- await pigeonVar_channel.send (< Object ? > [initialDirectory, allowedTypes])
223
- as List <Object ?>? ;
306
+ await pigeonVar_sendFuture as List <Object ?>? ;
224
307
if (pigeonVar_replyList == null ) {
225
308
throw _createConnectionError (pigeonVar_channelName);
226
309
} else if (pigeonVar_replyList.length > 1 ) {
@@ -251,9 +334,11 @@ class FileSelectorApi {
251
334
pigeonChannelCodec,
252
335
binaryMessenger: pigeonVar_binaryMessenger,
253
336
);
337
+ final Future <Object ?> pigeonVar_sendFuture = pigeonVar_channel.send (
338
+ < Object ? > [initialDirectory],
339
+ );
254
340
final List <Object ?>? pigeonVar_replyList =
255
- await pigeonVar_channel.send (< Object ? > [initialDirectory])
256
- as List <Object ?>? ;
341
+ await pigeonVar_sendFuture as List <Object ?>? ;
257
342
if (pigeonVar_replyList == null ) {
258
343
throw _createConnectionError (pigeonVar_channelName);
259
344
} else if (pigeonVar_replyList.length > 1 ) {
0 commit comments