diff --git a/packages/firebase_storage/firebase_storage/windows/firebase_storage_plugin.cpp b/packages/firebase_storage/firebase_storage/windows/firebase_storage_plugin.cpp index 6ae3a7e1d69d..5fcac57d17fe 100644 --- a/packages/firebase_storage/firebase_storage/windows/firebase_storage_plugin.cpp +++ b/packages/firebase_storage/firebase_storage/windows/firebase_storage_plugin.cpp @@ -470,22 +470,18 @@ void FirebaseStoragePlugin::ReferenceList( const InternalStorageReference& reference, const InternalListOptions& options, std::function reply)> result) { - // C++ doesn't support list yet - flutter::EncodableList items = flutter::EncodableList(); - flutter::EncodableList prefixs = flutter::EncodableList(); - InternalListResult pigeon_result = InternalListResult(items, prefixs); - result(pigeon_result); + result(FlutterError( + "unimplemented", + "Listing files is not supported by the Firebase C++ SDK on Windows.")); } void FirebaseStoragePlugin::ReferenceListAll( const InternalStorageFirebaseApp& app, const InternalStorageReference& reference, std::function reply)> result) { - // C++ doesn't support listAll yet - flutter::EncodableList items = flutter::EncodableList(); - flutter::EncodableList prefixs = flutter::EncodableList(); - InternalListResult pigeon_result = InternalListResult(items, prefixs); - result(pigeon_result); + result(FlutterError( + "unimplemented", + "Listing files is not supported by the Firebase C++ SDK on Windows.")); } void FirebaseStoragePlugin::ReferenceGetData( diff --git a/tests/integration_test/firebase_storage/reference_e2e.dart b/tests/integration_test/firebase_storage/reference_e2e.dart index f8477798d98e..5b382fb03767 100644 --- a/tests/integration_test/firebase_storage/reference_e2e.dart +++ b/tests/integration_test/firebase_storage/reference_e2e.dart @@ -224,6 +224,28 @@ void setupReferenceTests() { skip: defaultTargetPlatform == TargetPlatform.windows, ); + test( + 'list operations report that they are unsupported on Windows', + () async { + final Reference ref = storage.ref('flutter-tests/list'); + final unsupportedError = isA() + .having((error) => error.code, 'code', 'unimplemented') + .having( + (error) => error.message, + 'message', + 'Listing files is not supported by the Firebase C++ SDK on ' + 'Windows.', + ); + + await expectLater( + ref.list(const ListOptions(maxResults: 25)), + throwsA(unsupportedError), + ); + await expectLater(ref.listAll(), throwsA(unsupportedError)); + }, + skip: defaultTargetPlatform != TargetPlatform.windows, + ); + test( 'listAll', () async {