Flutter Bloc Tutorial For Beginners | BLoC Architecture/Pattern & State Management Explained

preview_player
Показать описание
In this course, we will learn about the Flutter Bloc State Management Tool along with the BLoC Architecture/Pattern by creating 4 Projects using Flutter! We will learn about Bloc, Cubit, BlocProvider, BlocBuilder, BlocConsumer, BlocListener, RepositoryProvider, BlocObserver and various methods and functionalities they offer. Along with that, we'll learn about Bloc vs Cubit, understanding when to use what and just simplifying Bloc down by a lot. We'll also learn about writing clean code by implementing BLoC Pattern in an API Powered Project.

Resources:

Timestamps:
(00:00:00) Introduction
(00:00:44) Project Setup + Bloc Installation
(00:03:39) Counter App With Cubit State Management - Overview
(00:30:38) Counter App With Bloc State Management - Overview
(00:49:48) Similarity Between Bloc & Cubit
(00:50:18) Todo List App With Cubit - BlocBuilder, onChange, onError
(01:11:59) Login Form App with Bloc - States, Events, BlocListener, BlocConsumer, onTransition, bloc_concurrency
(01:56:31) BlocObserver
(02:01:09) Weather App - BLoC Architecture Pattern
(02:30:18) BLoC Pattern Recap
(02:33:36) Is BLoC Unnecessary work?
(02:34:15) Conclusion

Connect With Me Here:
Рекомендации по теме
Комментарии
Автор

At 1:04:56, no offense, but the explanation seemed a bit flaky. Here are my 2 cents on why the state is not changing even after adding a new to-do object in the 'state' list.

When we first initiate the state with an empty list [], this list has an address in memory (say A1), similar to how a house has an address.

Continuing with this analogy, like how if more people start residing in the house, the address of the house does not change, similarly if we add more elements in the list, the address of the list will also not change.

The emit() function likely compares two states based on the r-value (which is address in the case of Lists, Maps, and objects, and the actual value in the case of primitives like int, float, double, etc).

Here emit() concludes that the state has not changed, since the address of the list has not changed, therefore it stops any further processing.

Therefore, to actually change the address of the list,
1. We have to create a copy of the list (This creates a new list with a new address (say A2))
2. Add the items in this new list
3. Pass this new list to emit()

Now when emit() compares the two lists, it finds that the address is different, and it updates the state. Hope this helped someone.

GameSteals
Автор

As of now, This man is God Gift for flutter developer, His insane contribution for Flutter Developers always be memorable in flutter history, this much quality content absolutely for free is ❤❤❤❤❤.

MrxAmjad
Автор

You're a genius! Unlike other YouTubers who explain everything at the beginning, you saved the block definition explanation for the end of the video. I really appreciate your content, and thanks to your 2-hour 30-minute tutorial, I successfully cracked the interview. Thank you!

AkshayGupta-qbyn
Автор

As my 7th-semester exams are concluding next week in pursuit of a CS degree, I'm eager to delve into Flutter projects.
I already have a grasp of Flutter and Dart basics. However, time is limited, and with companies beginning recruitment, I'm feeling the pressure due to the absence of projects.
I would greatly appreciate your guidance, Rivaan, including video recommendations to kickstart my Flutter journey, project ideas, and tips for both project development and placement preparation.
Your assistance means a lot 🙏🏻

LinuxUser_
Автор

You are the best thing ever happened to flutter. Your explanations are beginner friendly. Thanks

synnotus
Автор

This tutorial is a gem for Flutter developers. The explanations provided are incredibly detailed, making a complex pattern appear straightforward. I'm grateful for the thorough guidance provided by the instructor. Thank you, Master.❤

kevinvishal
Автор

Seen a lot of state management tutorials but this one is on Top.

hashir
Автор

Wow, I've been after some good, well explained bloc tutorials for a while and yours got literally all my questions answered. thank you so much!

samuelvmoura
Автор

Hats off
A big round of applause ✋
A big thanks for this 🙏

pratyushvaibhav
Автор

Thanks so much. This course was a long overdue for me but I finally got it done. I feel way more confident about Bloc and Cubit now.

Basslanyience
Автор

Thanks, it's really helpful because following the login tutorial from the bloc documentation wasn't enough for a beginner like me. You explain really well, thanks for your time

Mitsue
Автор

Manhhhh! This is the best tutorial out in YouTube for bloc state management
You are amazing

Vikram_Naik
Автор

I was wondering when Rivaan will move to bloc and here it is. Thank you for showing me a lot in flutter.

rolesquare
Автор

When I started watching, I thought "I won't sit here for 2.5 hours..." but I did. This is a great video which explains the subject matter very clearly with good examples.

richardwindley
Автор

Hey! Just wanted to say thanks! I was on the fence about whether to invest about 3 hours of my time in it, but I am glad I did. Your shown examples along with the explanations helped clear out a lot of the confusions and questions I had.

numan
Автор

Dear Rivaan, U have an excellent explanation skills bro ❤‍🔥, This one is a gem 😍

andrewspourgeon
Автор

Very valuable content. No one has taught like this❤

rakshithadilshan
Автор

I came to learn Bloc State Management and ended up as his fan. I love the way how he Explain and teach. If this course was on Udemy, he must hai Millions of Students by now. (An this course should be on Platforms like Udemy) 💯❣💫

SohaibSanaa
Автор

For those who don't know, Rivaan is only 17

DataSet
Автор

a big project with bloc and supabase would be very awesome & unique.

roninspect