How to Manage State in Flutter using BLoC for Beginners

Опубликовано: 02 Ноябрь 2024
на канале: The Flutter Factory
36,011
569

Bloc is the one of the best ways to manage state in your Flutter app. It can seem a bit confusing at first glance, but this video will hopefully clear up the confusion and show how easy it is to implement in any existing app.

00:00 - Intro
00:47 - Explaining initial code and the goal of this video
02:26 - Creating a BLoC Event class
05:59 - Creating the BLoC to define the state and handle the event
12:38 - Creating a BlocDelegate to intercept events, state changes, and related errors
15:25 - Assigning the BlocDelegate when the app starts
16:12 - Using a BlocProvider to provide the BLoC to the app
17:25 - Updating the BLoC state with an event
20:03 - Using a BlocConsumer to consume the BLoC state in a widget
23:49 - Showing a SnackBar message when a new event is found
24:45 - How to decide when a widget is rebuilt on new events
28:39 - Testing/Debugging (Adding and deleting items from the List state)

💻Get the Code: https://github.com/theflutterfactory/...

⚡Connect on Facebook:   / flutterfactory  

⚡Connect on Twitter:   / flutterfactory