The Best Flutter Bloc Complete Course - Visualise, Understand, Learn & Practice Bloc Concepts
Why Stack Overflow recommends it
Stack Overflow users link it when answering Flutter state management questions and when learning Bloc/Cubit concepts such as the widget tree and where to place a BlocProvider.
Recommended by 4 people across 4 different months, 2021 to 2022.
What it is
A 3 hour 23 minute Flutter Bloc course from the Flutterly channel that uses animated explainers and coding sections. It covers streams, Cubits and Blocs, then the Flutter widgets (BlocProvider, BlocBuilder, BlocListener) and the widget tree, with a companion GitHub repository.
What people said
Recommends Bill Sanderson · 2021-01 · Stack Overflow · on “placement of blocprovider for cbuit”
i found my answer in my better understanding of flutter widget tree after watching this video tutorial on bloc/cubit.. [this video]
Recommends csk · 2021-02 · Stack Overflow · on “How to globally listen from a flutter bloc?”
I have heard that using get_it with bloc is not a good idea... Especially in your case, where you are providing a bloc for the whole widget tree. Try to provide bloc without using get_it because you will have access to it in the whole app anyways. Here there is an interesting video about it: [this video]
Recommends Mohamed Mohamed · 2022-04 · Stack Overflow · on “Flutter Bloc: Many states within a screen, how to handle?”
Learning by example is always a good way to go, this [LINK] got me on my feet with BLoC as well as this [this video] . Essentially, your login page should house the main BLoC where you can pass in the email and pass values via the TextEditingController instead of having a separate BLoC for every textfield/widget.
Recommends Matthew Trent · 2022-09 · Stack Overflow · on “Flutter: State management”
My new state management lib recommendation: I recommend just using Trent ( [LINK] ) for state management. It's like BLoC, but simpler. Lots of examples in the README on GitHub. Full disclosure: I made it. Old answer: BLoC/Cubit BLoC is great for complex state management for complex apps. However, inside the BLoC library there's a simpler way of managing state that's called Cubit (Cubit is sort of a subset of BLoC). Cubit is largely the same as BLoC except: less boilerplate doesn't use 2-way streams This renders it much easier to learn, and a fantastic stepping-stone into a full-out BLoC driven state management solution. Currently, my team and I are building a very complex app, and we use the
Cites IcyHerrscher · 2021-10 · Stack Overflow · on “Calling function after calling super constructor in bloc constructor”
I was watching a tutorial [this video] about bloc and stream subscription and I noticed this piece of code. Right after the super constructor, he called a function. class InternetCubit extends Cubit<InternetState> { final Connectivity connectivity; late StreamSubscription connectivityStreamSubscription; InternetCubit({required this.connectivity}) : super(InternetLoading()) { connectivityStreamSubscription = connectivity.onConnectivityChanged.listen((ConnectivityResult connectivityResult) { if(connectivityResult == ConnectivityResult.wifi){ emitInternetConnected(ConnectionType.Wifi); } else if(connectivityResult == ConnectivityResult.mobile){ emitInternetConnected(ConnectionType.Mobile); }else if(
Cites Omar Khaium Chowdhury · 2022-01 · Stack Overflow · on “Navigator.of(context) is not navigating, giving null value error on context”
Basically, you're facing an issue, that is so silly, you'll laugh at yourself after knowing the cause of the error (take it as sarcasm). The main point here is, we use context to refer to our class's reference or location inside the widget tree. So, pointing the wrong context will always be error-prone. What you need to do is to point to the accurate context variable to navigate properly. I will suggest you rename all the context variables, so you'll know which exact context you're using to navigate. What you need to do is to pass the root context variable that was provided to your state-full/less widget's build function. See the example below: class SignInScreen extends StatefulWidget { @ov