Skip to content

Jei-sKappa/stream_listenable

Repository files navigation

stream_listenable

A Dart/Flutter monorepo that bridges Stream<T> and BLoC into Flutter's Listenable / ValueListenable interfaces.

Use any Stream or BlocBase with ListenableBuilder, ValueListenableBuilder, AnimatedBuilder, and other Listenable-based APIs — without rewriting your state management.

Packages

Package Description pub.dev
stream_listenable Core adapters and Stream extensions pub package
bloc_listenable BlocBase extensions (built on stream_listenable) pub package

Quick example

// Stream -> ValueListenable
final counter = myStream.asValueListenable(initialValue: 0);

ValueListenableBuilder<int>(
  valueListenable: counter,
  builder: (context, value, child) => Text('$value'),
);

// BLoC -> ValueListenable
ValueListenableBuilder<int>(
  valueListenable: myCubit.asValueListenable(),
  builder: (context, value, child) => Text('$value'),
);

License

MIT

About

Wrapper and extensions to convert Stream / BLoC to Listenable / ValueListenable.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors