Skip to content

Commit 6be3abf

Browse files
binSaedmartijn00
authored andcommitted
add statusCode to file_info.dart
1 parent 980b33b commit 6be3abf

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

flutter_cache_manager/lib/src/result/file_info.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ enum FileSource { NA, Cache, Online }
1212
/// FileInfo contains the fetch File next to some info on the validity and
1313
/// the origin of the file.
1414
class FileInfo extends FileResponse {
15-
const FileInfo(this.file, this.source, this.validTill, String originalUrl)
15+
const FileInfo(this.file, this.source, this.validTill, String originalUrl,
16+
{this.statusCode = 200})
1617
: super(originalUrl);
1718

1819
/// Fetched file
@@ -24,4 +25,6 @@ class FileInfo extends FileResponse {
2425
/// Validity date of the file. After this date the validity is not guaranteed
2526
/// and the CacheManager will try to update the file.
2627
final DateTime validTill;
28+
29+
final int statusCode;
2730
}

flutter_cache_manager/lib/src/web/web_helper.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ class WebHelper {
153153
FileSource.Online,
154154
newCacheObject.validTill,
155155
newCacheObject.url,
156+
statusCode: response.statusCode,
156157
);
157158
}
158159

0 commit comments

Comments
 (0)