CacheItem class

Constructors

CacheItem({required String key, required String data, required DateTime createdAt, required DateTime expiresAt, required int priority, required int size})
const
CacheItem.fromJson(Map<String, dynamic> json, {ValueSerializer? serializer})
factory

Properties

createdAt DateTime
创建时间
final
data String
缓存数据 (JSON格式)
final
expiresAt DateTime
过期时间
final
hashCode int
The hash code for this object.
no setteroverride
key String
缓存键
final
priority int
优先级 (0-10)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int
大小 (字节)
final

Methods

copyWith({String? key, String? data, DateTime? createdAt, DateTime? expiresAt, int? priority, int? size}) CacheItem
copyWithCompanion(CacheItemsCompanion data) CacheItem
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toColumns(bool nullToAbsent) Map<String, Expression<Object>>
Converts this object into a map of column names to expressions to insert or update.
toCompanion(bool nullToAbsent) CacheItemsCompanion
toJson({ValueSerializer? serializer}) Map<String, dynamic>
Converts this object into a representation that can be encoded with json. The serializer can be used to configure how individual values will be encoded. By default, DriftRuntimeOptions.defaultSerializer will be used. See ValueSerializer.defaults for details.
toJsonString({ValueSerializer? serializer}) String
Converts this object into a json representation. The serializer can be used to configure how individual values will be encoded. By default, DriftRuntimeOptions.defaultSerializer will be used. See ValueSerializer.defaults for details.
inherited
toString() String
A string representation of this object.
override

Operators

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