Cacheable class
Marks a class as serializable by quantum_cache's code generator.
When applied to a class, the build_runner code generator will produce a
<ClassName>Adapter in a companion .g.dart file.
Example:
part 'product.g.dart';
@Cacheable(typeId: 5)
class Product {
@CacheField(0) final String id;
@CacheField(1) final String name;
@CacheField(2) final double price;
@CacheField(3) final DateTime createdAt;
const Product({
required this.id,
required this.name,
required this.price,
required this.createdAt,
});
}
Then register the adapter once at startup:
SuperCache.registerAdapter(ProductAdapter());
await SuperCache.init();
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited