Cacheable<T extends Snowflake, S extends SnowflakeEntity> class Null safety

Wraps SnowflakeEntity that can be taken from cache or optionally downloaded from API. Always provides id of entity. download() method tries to get entity from API and returns it upon success or throws Error if something happens in the process.


hashCode int
The hash code for this object. [...]
read-only, override
id → T
Id of entity
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


download() Future<S>
Downloads entity from cache and caches result
getFromCache() → S?
Returns entity from cache or null if not present
getOrDownload() FutureOr<S>
Returns entity from cache or tries to download from API if not found. If downloading is successful it caches results
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toString() String
A string representation of this object. [...]


operator ==(Object other) bool
The equality operator. [...]