I want to know how to manage BLoC
pattern for Firebase
.
I couldn't find any example of BLoC
for Firebase
so it might be broad but forgive me.
I saw some basic BLoC
implementation but those were basically fetch data or updating view in a active way not passive way also not through database(almost API JSON stuff).
So, I want to see how to handle some BLoC
pattern for Firestore
like get followed(passive way), when user update own profile info something like that.
Does anyone lead me to the correct way?
Any help is highly appreciated!
What BLoC pattern gives you is nothing more than a data stream that can be updated adding new data through the stream.sink
.
Using Firestore you already have a data stream, so you might not need BLoC.
If your application requires a more complex logic you might update you BLoC data adding a listener to a firestore ref in the root widget to have db and bloc always in sync (maybe with multiple blocs for multiple db refs).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With