MetadataMixin mixin

A mixin that provides a simple way to add metadata to a class.

Mixin applications

Properties

hashCode int
The hash code for this object.
no setterinherited
metadata Map<Object, Object?>
Returns a read-only map of all metadata entries.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearMeta() → void
Clears all metadata entries.
getMeta<T>({Object? key, T orElse()?}) → T
Returns the metadata entry for the given key or type argument. If no metadata entry is found, throws an exception or automatically calls the orElse function to initialize the metadata entry and return it.
getMetaOrNull<T>([Object? key]) → T?
Returns the metadata entry for the given key or type argument. If no metadata entry is found, returns null.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setMeta<T>(T value, {Object? key}) → void
Sets the metadata entry for the given key or type argument.
toString() String
A string representation of this object.
inherited

Operators

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