FileCache class

Constructors

FileCache({required String path, Loader loader = defaultLoader})

Properties

hashCode int
The hash code for this object.
no setterinherited
loader Loader
Load (Http Response) if file not exists.
final
path String
cache folder
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stats → CacheStats
final

Methods

cacheableSeconds(HttpClientResponse response) int?
Parse http header Cache-Control: max-age=300 return 300 expire seconds
clean() Future<bool>
extractSeconds(String val) int?
getBytes(String url, {Encoding storeEncoding = utf8, int? forceCache}) Future<Uint8List>
getJson(String url, {Encoding encoding = utf8}) Future<Map>
getString(String url, {Encoding encoding = utf8}) Future<String>
load(String url) Future<CacheEntry?>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(String url) Future<bool>
scanFolder() Future<ScanResult>
store(String url, CacheEntry entry, {Encoding encoding = utf8}) Future<void>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromDefault({Loader loader = defaultLoader, String? path, bool scan = false}) Future<FileCache>
We can provider capabity for multi instance. This function ONLY for convenience