CachedContextProvider mixin

Shares in-flight context collection and caches successful values for cacheDuration. Collection failures return an empty map.

Superclass constraints
Mixin applications

Properties

cacheDuration → Duration
Cache TTL for this provider. Keep short for dynamic data, longer for static.
no setter
hashCode → int
The hash code for this object.
no setterinherited
manualReportOnly → bool
If true, this context is collected only for manual user‑initiated reports (e.g., when the user taps "Send diagnostics"), and not for automatic background reporting.
no setterinherited
name → String
The key under which this provider's map is attached to the report context.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearCache() → void
Forces the next call to collect fresh context. Pending callers can finish with their original result without replacing the new cached value.
collect() → FutureOr<Map<String, dynamic>>
Override this instead of getData to implement the actual data collection.
getData() → Future<Map<String, dynamic>>
Collects context data. Implementations must never throw; if an internal error occurs, return an empty map instead.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
validateData(Map<String, dynamic> data) → bool
Optional validation; return true to keep the data in the report. The default keeps any non‑empty map.
inherited

Operators

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