LxFamily<K, R extends LxReactive> class
Lazily creates, caches, and disposes reactive resources by key.
Raw keys are never included in diagnostic names unless debugKey is explicitly provided.
Constructors
- LxFamily(R _builder(K key), {LxFamilyEviction eviction = const LxFamilyEviction.keepAlive(), String? name, String debugKey(K key)?})
- Creates a keyed reactive family.
Properties
- debugKey → String Function(K key)?
-
Optional application-controlled safe key formatter.
final
- eviction → LxFamilyEviction
-
Eviction policy applied to cached entries.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDisposed → bool
-
Whether the family has been permanently closed.
no setter
-
keys
→ Iterable<
K> -
Snapshot of cached keys.
no setter
- length → int
-
Number of currently cached keyed resources.
no setter
- name → String?
-
Optional stable diagnostic prefix.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
call(
K key) → R -
Returns the existing entry for
keyor creates it lazily. -
close(
) → void - Permanently closes the family and all cached entries.
-
containsKey(
K key) → bool -
Whether
keycurrently has a cached entry. -
invalidate(
K key) → bool -
Invalidates and closes the entry associated with
key. -
invalidateAll(
) → void - Invalidates and closes every cached entry.
-
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