Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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/file_selector/file_selector_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.5.1+17

* Updates Pigeon to 26.x.

## 0.5.1+16

* Bumps com.android.tools.build:gradle to 8.12.1.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2013 The Flutter Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Autogenerated from Pigeon (v22.6.2), do not edit directly.
// Autogenerated from Pigeon (v26.0.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon

package dev.flutter.packages.file_selector_android;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2013 The Flutter Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Autogenerated from Pigeon (v22.6.2), do not edit directly.
// Autogenerated from Pigeon (v26.0.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, no_leading_underscores_for_local_identifiers

Expand All @@ -18,6 +18,24 @@ PlatformException _createConnectionError(String channelName) {
);
}

bool _deepEquals(Object? a, Object? b) {
if (a is List && b is List) {
return a.length == b.length &&
a.indexed.every(
((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]),
);
}
if (a is Map && b is Map) {
return a.length == b.length &&
a.entries.every(
(MapEntry<Object?, Object?> entry) =>
(b as Map<Object?, Object?>).containsKey(entry.key) &&
_deepEquals(entry.value, b[entry.key]),
);
}
return a == b;
}

enum FileSelectorExceptionCode {
securityException,
ioException,
Expand All @@ -35,17 +53,38 @@ class FileSelectorNativeException {

String message;

Object encode() {
List<Object?> _toList() {
return <Object?>[fileSelectorExceptionCode, message];
}

Object encode() {
return _toList();
}

static FileSelectorNativeException decode(Object result) {
result as List<Object?>;
return FileSelectorNativeException(
fileSelectorExceptionCode: result[0]! as FileSelectorExceptionCode,
message: result[1]! as String,
);
}

@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! FileSelectorNativeException ||
other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(encode(), other.encode());
}

@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hashAll(_toList());
}

class FileResponse {
Expand All @@ -70,7 +109,7 @@ class FileResponse {

FileSelectorNativeException? fileSelectorNativeException;

Object encode() {
List<Object?> _toList() {
return <Object?>[
path,
mimeType,
Expand All @@ -81,6 +120,10 @@ class FileResponse {
];
}

Object encode() {
return _toList();
}

static FileResponse decode(Object result) {
result as List<Object?>;
return FileResponse(
Expand All @@ -92,6 +135,22 @@ class FileResponse {
fileSelectorNativeException: result[5] as FileSelectorNativeException?,
);
}

@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! FileResponse || other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(encode(), other.encode());
}

@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hashAll(_toList());
}

class FileTypes {
Expand All @@ -101,17 +160,37 @@ class FileTypes {

List<String> extensions;

Object encode() {
List<Object?> _toList() {
return <Object?>[mimeTypes, extensions];
}

Object encode() {
return _toList();
}

static FileTypes decode(Object result) {
result as List<Object?>;
return FileTypes(
mimeTypes: (result[0] as List<Object?>?)!.cast<String>(),
extensions: (result[1] as List<Object?>?)!.cast<String>(),
);
}

@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! FileTypes || other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(encode(), other.encode());
}

@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hashAll(_toList());
}

class _PigeonCodec extends StandardMessageCodec {
Expand Down Expand Up @@ -188,9 +267,11 @@ class FileSelectorApi {
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
<Object?>[initialDirectory, allowedTypes],
);
final List<Object?>? pigeonVar_replyList =
await pigeonVar_channel.send(<Object?>[initialDirectory, allowedTypes])
as List<Object?>?;
await pigeonVar_sendFuture as List<Object?>?;
if (pigeonVar_replyList == null) {
throw _createConnectionError(pigeonVar_channelName);
} else if (pigeonVar_replyList.length > 1) {
Expand Down Expand Up @@ -218,9 +299,11 @@ class FileSelectorApi {
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
<Object?>[initialDirectory, allowedTypes],
);
final List<Object?>? pigeonVar_replyList =
await pigeonVar_channel.send(<Object?>[initialDirectory, allowedTypes])
as List<Object?>?;
await pigeonVar_sendFuture as List<Object?>?;
if (pigeonVar_replyList == null) {
throw _createConnectionError(pigeonVar_channelName);
} else if (pigeonVar_replyList.length > 1) {
Expand Down Expand Up @@ -251,9 +334,11 @@ class FileSelectorApi {
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
<Object?>[initialDirectory],
);
final List<Object?>? pigeonVar_replyList =
await pigeonVar_channel.send(<Object?>[initialDirectory])
as List<Object?>?;
await pigeonVar_sendFuture as List<Object?>?;
if (pigeonVar_replyList == null) {
throw _createConnectionError(pigeonVar_channelName);
} else if (pigeonVar_replyList.length > 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ enum FileSelectorExceptionCode {
illegalStateException, //unused
}

class FileSelectorNativeException implements Exception {
class FileSelectorNativeException {
late final FileSelectorExceptionCode fileSelectorExceptionCode;
late final String message;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/file_selector/file_selector_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: file_selector_android
description: Android implementation of the file_selector package.
repository: https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22
version: 0.5.1+16
version: 0.5.1+17

environment:
sdk: ^3.7.0
Expand All @@ -28,7 +28,7 @@ dev_dependencies:
flutter_test:
sdk: flutter
mockito: ^5.4.4
pigeon: ^22.4.2
pigeon: ^26.0.1

topics:
- files
Expand Down