File tree Expand file tree Collapse file tree 4 files changed +11
-11
lines changed
amplify_core/lib/src/types/storage
amplify_storage_s3/example/integration_test Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -9,14 +9,14 @@ import 'package:amplify_core/amplify_core.dart';
99class StorageListResult <Item extends StorageItem > {
1010 /// {@macro amplify_core.storage.list_result}
1111 const StorageListResult (
12- this .excludedSubpaths,
1312 this .items, {
13+ this .excludedSubpaths,
1414 required this .hasNextPage,
1515 this .nextToken,
1616 });
1717
1818 /// The subpaths that have been excluded
19- final List <String > excludedSubpaths;
19+ final List <String >? excludedSubpaths;
2020
2121 /// The objects listed in the current page.
2222 final List <Item > items;
Original file line number Diff line number Diff line change @@ -84,8 +84,8 @@ void main() {
8484 expect (listResult.items.length, 3 );
8585 expect (listResult.items.first.path, contains ('file1.txt' ));
8686
87- expect (listResult.excludedSubpaths.length, 1 );
88- expect (listResult.excludedSubpaths.first, '$uniquePrefix /subdir/' );
87+ expect (listResult.excludedSubpaths? .length, 1 );
88+ expect (listResult.excludedSubpaths? .first, '$uniquePrefix /subdir/' );
8989 expect (listResult.metadata.delimiter, '/' );
9090 });
9191
@@ -101,9 +101,9 @@ void main() {
101101 expect (listResult.items.length, 3 );
102102 expect (listResult.items.first.path, contains ('file1.txt' ));
103103
104- expect (listResult.excludedSubpaths.length, 1 );
104+ expect (listResult.excludedSubpaths? .length, 1 );
105105 expect (
106- listResult.excludedSubpaths.first,
106+ listResult.excludedSubpaths? .first,
107107 '$uniquePrefix /subdir2#' ,
108108 );
109109 expect (listResult.metadata.delimiter, '#' );
Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ class S3ListResult extends StorageListResult<S3Item> {
3939 final items = output.contents? .map (S3Item .fromS3Object).toList ();
4040
4141 return S3ListResult (
42- subPaths ?? < String > [],
4342 items ?? const < S3Item > [],
43+ excludedSubpaths: subPaths ?? < String > [],
4444 hasNextPage: paginatedResult.hasNext,
4545 nextToken: paginatedResult.nextContinuationToken,
4646 metadata: metadata,
@@ -52,13 +52,13 @@ class S3ListResult extends StorageListResult<S3Item> {
5252 final items = < S3Item > [...this .items, ...other.items];
5353
5454 final mergedSubPaths = < String > [
55- ...excludedSubpaths,
56- ...other.excludedSubpaths,
55+ ...excludedSubpaths ?? < String > [] ,
56+ ...other.excludedSubpaths ?? < String > [] ,
5757 ];
5858
5959 return S3ListResult (
60- mergedSubPaths,
6160 items,
61+ excludedSubpaths: mergedSubPaths,
6262 hasNextPage: other.hasNextPage,
6363 nextToken: other.nextToken,
6464 metadata: metadata,
Original file line number Diff line number Diff line change @@ -86,8 +86,8 @@ void main() {
8686 group ('list()' , () {
8787 const testPath = StoragePath .fromString ('some/path' );
8888 final testResult = S3ListResult (
89- < String > [],
9089 < S3Item > [],
90+ excludedSubpaths: < String > [],
9191 hasNextPage: false ,
9292 metadata: S3ListMetadata .fromDelimiter (),
9393 );
You can’t perform that action at this time.
0 commit comments