flutter_caffeine 2.0.0
flutter_caffeine: ^2.0.0 copied to clipboard
Flutter bindings for caffeine. Attach reactive scopes to the widget tree, read store state with context.state(), fire events with context.fire() — no StreamBuilders, no dispose boilerplate.
2.0.0 #
Aligned with caffeine 2.0.0.
Breaking changes:
context.state(node)— parameter type changed fromStateful<T>toStore<T>context.fire(event)— now requires an explicit value argument:context.fire(event, value)
Improvements:
Caffeine.of()throws aFlutterErrorinstead of asserting — error is surfaced in release mode with a descriptive messageCaffeineInheritedconstructor forwardskey
1.0.0 #
Initial release.
Caffeinewidget — attaches a caffeineScopeto a point in the element tree and disposes it when the element is removedcontext.state(node)— reads aStatefulorStorevalue from the nearestCaffeineancestor; subscribes to automatic rebuilds whenlisten: true(the default)context.fire(event)— dispatches an event through the nearestCaffeineancestor's scopeCaffeine.of(context)— retrieves the nearestScopefor forking child scopes- Subscription cleanup via
Finalizer— nodisposeoverrides or wrapper widgets required