RxNetCache class
author:郑再红 email:1096877329@qq.com date:2026-08-06 16:45 describe:缓存辅助类
Constructors
- RxNetCache({RxNetDataBase? database, int cacheInvalidationTime = 365 * 24 * 60 * 60 * 1000, int maxCacheSize = 0, CacheEvictionPolicy evictionPolicy = CacheEvictionPolicy.none})
Properties
- evictionPolicy → CacheEvictionPolicy
-
当前淘汰策略
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxCacheSize → int
-
当前最大缓存条目数
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearAll(
) → Future< void> -
clearByPattern(
String pattern) → Future< void> -
clearByPrefix(
String prefix) → Future< void> -
exists(
String key) → Future< bool> -
get<
T> (String key) → Future< T?> -
getAllKeys(
) → Future< List< String> > -
getCacheSize(
) → Future< int> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
put(
String key, dynamic value) → Future< void> -
readNetworkCache(
{required String path, required Map< String, dynamic> params, List<String> ? ignoreKeys, int? cacheInvalidationTime}) → Future -
remove(
String key) → Future< void> -
saveNetworkCache(
{required String path, required Map< String, dynamic> params, required dynamic responseData, List<String> ? ignoreKeys}) → Future<void> -
setCacheInvalidationTime(
int time) → void -
setDatabase(
RxNetDataBase database) → void -
setEvictionPolicy(
CacheEvictionPolicy policy) → void -
setMaxCacheSize(
int size) → void -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited