BloomData class
Properties
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
toString()
→ String
-
A string representation of this object.
inherited
Static Methods
-
clear()
→ void
-
Clears the current scope's entries, in-flight trackers, and controllers.
-
createScope({String? debugLabel})
→ BloomQueryScope
-
Creates a fresh isolated scope (one per SSR request).
-
deduplicate<T>(List key, Future<T> fetcher())
→ Future<T>
-
Deduplicates concurrent asynchronous requests sharing the same cache
key.
-
dehydrate({bool shouldDehydrate(QueryCacheEntry entry)?, dynamic serialize(dynamic data, List key)?})
→ Map<String, dynamic>
-
Serializes the current request scope's cache into a plain, JSON-encodable Map.
-
dehydrateToScriptTag({Map<String, dynamic>? state, String id = '__BLOOM_DATA__', bool shouldDehydrate(QueryCacheEntry entry)?, dynamic serialize(dynamic data, List key)?})
→ String
-
Serializes the current scope's state into an HTML
<script type="application/json"> tag string.
-
disposeCurrentScope()
→ void
-
Disposes the current request scope if one is active (no-op otherwise).
-
getEntry<T>(List key)
→ QueryCacheEntry<T>?
-
Retrieves the raw QueryCacheEntry for
key from the current scope.
-
getQueryData<T>(List key)
→ T?
-
Retrieves non-expired cached query data for
key, or returns null if absent or expired.
-
hydrate(Map<String, dynamic> dehydratedState, {dynamic deserialize(dynamic data, List key)?})
→ void
-
Restores cache records from a
dehydratedState Map into the current scope.
-
hydrateFromJson(String jsonString, {dynamic deserialize(dynamic data, List key)?})
→ void
-
Parses a serialized JSON string and restores entries into the current scope.
-
invalidateQueries(List keyPrefix)
→ void
-
Invalidates all cached queries matching
keyPrefix and notifies subscribers.
-
matchesKey(List candidateKey, List prefix)
→ bool
-
Prefix-match helper shared by scopes.
-
normalizeKey(List key)
→ String
-
Converts a structured key list into a normalized, canonical string key.
-
onInvalidated(List key)
→ Stream<void>
-
Returns a broadcast Stream that emits whenever queries matching
key are invalidated.
-
putEntry<T>(QueryCacheEntry<T> entry)
→ void
-
Directly inserts or overwrites a QueryCacheEntry in the current scope.
-
runWithScope<R>(BloomQueryScope scope, R body())
→ R
-
Runs
body with scope as the current request scope.
-
setQueryData<T>(List key, T updater(T? oldData))
→ void
-
Directly updates cached query data for
key using a transformation updater callback.
-
withRequestScope<T>(FutureOr<T> body(BloomQueryScope scope), {BloomQueryScope? scope, String? debugLabel})
→ Future<T>
-
Runs
body in a fresh request scope, disposing it afterwards.
-
withRequestScopeStream<S>(Stream<S> body(BloomQueryScope scope), {BloomQueryScope? scope, String? debugLabel})
→ Stream<S>
-
Variant of withRequestScope for
Stream results (streaming SSR).