maybeBloomOf<T> method

Bloom<T?> maybeBloomOf<T>()

Reactively subscribes to an optional ancestor BloomProvider and returns its inner Bloom state.

Exact Type Resolution: Lookup matches the exact reified type T. Subtypes or base classes do not match.

Ensures:

Examples

final optionalTheme = context.maybeBloomOf<AppTheme>();

Implementation

@pragma('vm:prefer-inline')
Bloom<T?> maybeBloomOf<T>() {
  final provider = dependOnInheritedWidgetOfExactType<BloomProvider<T>>();
  return provider?.bloom ?? Bloom.constantNull;
}