Skip to content

Commit c8f851f

Browse files
committed
add statusCode to file_info.dart
1 parent 073c74b commit c8f851f

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
@@ -154,6 +154,7 @@ class WebHelper {
154154
FileSource.Online,
155155
newCacheObject.validTill,
156156
newCacheObject.url,
157+
statusCode: response.statusCode,
157158
);
158159
}
159160

0 commit comments

Comments
 (0)