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';
9
9
class StorageListResult <Item extends StorageItem > {
10
10
/// {@macro amplify_core.storage.list_result}
11
11
const StorageListResult (
12
- this .excludedSubpaths,
13
12
this .items, {
13
+ this .excludedSubpaths,
14
14
required this .hasNextPage,
15
15
this .nextToken,
16
16
});
17
17
18
18
/// The subpaths that have been excluded
19
- final List <String > excludedSubpaths;
19
+ final List <String >? excludedSubpaths;
20
20
21
21
/// The objects listed in the current page.
22
22
final List <Item > items;
Original file line number Diff line number Diff line change @@ -84,8 +84,8 @@ void main() {
84
84
expect (listResult.items.length, 3 );
85
85
expect (listResult.items.first.path, contains ('file1.txt' ));
86
86
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/' );
89
89
expect (listResult.metadata.delimiter, '/' );
90
90
});
91
91
@@ -101,9 +101,9 @@ void main() {
101
101
expect (listResult.items.length, 3 );
102
102
expect (listResult.items.first.path, contains ('file1.txt' ));
103
103
104
- expect (listResult.excludedSubpaths.length, 1 );
104
+ expect (listResult.excludedSubpaths? .length, 1 );
105
105
expect (
106
- listResult.excludedSubpaths.first,
106
+ listResult.excludedSubpaths? .first,
107
107
'$uniquePrefix /subdir2#' ,
108
108
);
109
109
expect (listResult.metadata.delimiter, '#' );
Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ class S3ListResult extends StorageListResult<S3Item> {
39
39
final items = output.contents? .map (S3Item .fromS3Object).toList ();
40
40
41
41
return S3ListResult (
42
- subPaths ?? < String > [],
43
42
items ?? const < S3Item > [],
43
+ excludedSubpaths: subPaths ?? < String > [],
44
44
hasNextPage: paginatedResult.hasNext,
45
45
nextToken: paginatedResult.nextContinuationToken,
46
46
metadata: metadata,
@@ -52,13 +52,13 @@ class S3ListResult extends StorageListResult<S3Item> {
52
52
final items = < S3Item > [...this .items, ...other.items];
53
53
54
54
final mergedSubPaths = < String > [
55
- ...excludedSubpaths,
56
- ...other.excludedSubpaths,
55
+ ...excludedSubpaths ?? < String > [] ,
56
+ ...other.excludedSubpaths ?? < String > [] ,
57
57
];
58
58
59
59
return S3ListResult (
60
- mergedSubPaths,
61
60
items,
61
+ excludedSubpaths: mergedSubPaths,
62
62
hasNextPage: other.hasNextPage,
63
63
nextToken: other.nextToken,
64
64
metadata: metadata,
Original file line number Diff line number Diff line change @@ -86,8 +86,8 @@ void main() {
86
86
group ('list()' , () {
87
87
const testPath = StoragePath .fromString ('some/path' );
88
88
final testResult = S3ListResult (
89
- < String > [],
90
89
< S3Item > [],
90
+ excludedSubpaths: < String > [],
91
91
hasNextPage: false ,
92
92
metadata: S3ListMetadata .fromDelimiter (),
93
93
);
You can’t perform that action at this time.
0 commit comments