This repository demonstrates multiple methods for communicating between BLoCs in a Flutter application.
- Shared Repository/Service
- Event Bus with Dependency Injection
- Custom StreamController
Shared Repository or Service allows BLoCs to communicate by listening to changes in a shared resource.
An Event Bus decouples BLoCs and allows them to communicate by emitting and listening for events. Using Dependency Injection with get_it
enhances modularity.
A custom StreamController
provides a direct way for BLoCs to communicate through a shared stream.
- Flutter SDK
- Dart SDK
- Clone the repository
git clone https://github.com/mhmdVoj/flutter_bloc_communication.git