No video

Clearly Explained Flutter BlocProvider and RepositoryProvider

  Рет қаралды 6,378

dbestech

dbestech

Күн бұрын

Clearly Explained Flutter BlocProvider and RepositoryProvider
www.dbestech.c...
Production ready Bloc e-eommerce app with clean architecture
• Flutter Production Rea...
Latest about this app is here
www.dbestech.c...

Пікірлер: 32
@avishetty8
@avishetty8 Жыл бұрын
Thanks a lot. I understood. However, can you please, while recording your videos, increase your audio level. I just could not hear you clearly. I had to increase the volume to 80%. thanks a lot.
@nevilleraheemdavis5568
@nevilleraheemdavis5568 5 ай бұрын
Why not connect the data layer to the repository class?
@dbestech
@dbestech 5 ай бұрын
We can do that as well
@barnabassolomon1629
@barnabassolomon1629 7 ай бұрын
In ur authstate why are overriding list??
@MuhammadRizki-cl3ru
@MuhammadRizki-cl3ru Жыл бұрын
thanks for good videos , but i still confuse what is the main function of RepositoryProvider? what the difference between RepositoryProvider and blocprovider ?
@MuhammadRizki-cl3ru
@MuhammadRizki-cl3ru Жыл бұрын
for get data from api it is possible right with only use bloc ?
@dbestech
@dbestech Жыл бұрын
yes, you can but you should only trigger events in bloc, not really do other things.If you load data from bloc, your code will soon get messy.
@gyanupadhyay9473
@gyanupadhyay9473 Жыл бұрын
can we get the whole authentication video with bloc?
@dbestech
@dbestech Жыл бұрын
yes, I recorded half. I am too busy. maybe tomorrow release
@gyanupadhyay9473
@gyanupadhyay9473 Жыл бұрын
@@dbestech okk , thanks
@bhuvanachandra5121
@bhuvanachandra5121 Жыл бұрын
what happens if we directly give AuthRepository() to the BlocProvider instead of using RepositoryProvider() ?
@dbestech
@dbestech Жыл бұрын
If you don't do using RepositoryProvider(), you would load the data, from initState() or other kind of mechanism. Or using an event
@bhuvanachandra5121
@bhuvanachandra5121 Жыл бұрын
@@dbestech is it fine if we don't use the RepositoryProvider()?
@dbestech
@dbestech Жыл бұрын
@@bhuvanachandra5121 you can skip that, but in that case we need to load the repos differently
@christianmarpert3844
@christianmarpert3844 Жыл бұрын
Hi, great explanation! thks! I am using flutter_bloc, but no provider widgets at all. I use get_it to create and register all the instances and pass it to the bloc argument on the BlocBuilder and BlocListener. This way I am widget and context independent, which helps especially when routing. Still, you have to manage the closing of the bloc stream yourself, which otherwise is handled for you through the providers. what do you think of tis approach? thks👍
@student3506
@student3506 Жыл бұрын
Thank you. Great session! Could you share the source code?
@dbestech
@dbestech Жыл бұрын
The code is not complete yet
@saqib399
@saqib399 9 ай бұрын
"Thanks for the video. However, I'm still a bit confused about the practical use of RepositoryProvider. Could someone help clarify whether I understood it correctly or not? Suppose I want to use flutter_bloc in a weather app. When the user triggers an event to get the weather for a particular location, my understanding is that instead of fetching data directly from the API within the bloc class, we would trigger (or call) a method from our repository class. Based on the result obtained, we'll then update the state. Is this the correct usage of RepositoryProvider in this scenario? Any insights would be greatly appreciated!"
@BrunoMazzocchi
@BrunoMazzocchi Ай бұрын
Well, first of all we need to know why we used a repository. Using a repository in software architecture helps separate concerns by defining how data is fetched from remote or local sources within the data layer, rather than directly from the bloc. We could create a repository's instance inside the bloc but this will create another dependency between the bloc and the repository, so we inject the repository through the constructor of the bloc. Instead of creating multiple instances or using a third-party library like get_it, we can use RepositoryProvider to instantiate the repository once and pass it through the context, allowing the repository to be accessed when needed.
@saqibwani1921
@saqibwani1921 Ай бұрын
@@BrunoMazzocchi Thanks
@gyanupadhyay9473
@gyanupadhyay9473 Жыл бұрын
can we also use bloc builder in place of stream builder in above example?
@dbestech
@dbestech Жыл бұрын
StreamBuilder would help you to know auth changes about firebase auth
@dbestech
@dbestech Жыл бұрын
BlocBuilder would not do it
@Liv_Life
@Liv_Life Жыл бұрын
Nice explanation
@dbestech
@dbestech Жыл бұрын
Thanks for liking
@paulocbbf
@paulocbbf Жыл бұрын
It's so hard to understand all the multitude of patterns used in a simple app. Maybe that's why it's so difficult for Flutter to take its seat. I looked for so long for an updated tutorial that encompassed: fetch data from external source (firebase is a good one, or any api), have it stored locally, and relay this data on to widgets. I've only seen parts of this and it's not manageable. Some tutorials teach bloc, others providers, some simple widgets, some local storage and some Dio, but not one of them employ the full solution. :(
@dbestech
@dbestech Жыл бұрын
sorry, you may ask questions to me.
@amarubenj17
@amarubenj17 Жыл бұрын
Hello, im looking for a flutter developer who is good with bloc and state management for a project
@dbestech
@dbestech Жыл бұрын
freelancing?
@amarubenj17
@amarubenj17 Жыл бұрын
@@dbestech yes! If you could help that would be nice!
@amarubenj17
@amarubenj17 Жыл бұрын
You’re the goat 🐐
@peshawaamin3083
@peshawaamin3083 Жыл бұрын
❤️❤️
What is BLOC in flutter
10:13
Hitesh Choudhary
Рет қаралды 63 М.
Son ❤️ #shorts by Leisi Show
00:41
Leisi Show
Рет қаралды 10 МЛН
KMP vs. Flutter - Who Will Win The Cross-Platform Battle?
16:19
Philipp Lackner
Рет қаралды 42 М.
Flutter State Management - The Grand Tour
14:07
Fireship
Рет қаралды 240 М.
Repository Pattern
11:08
Coding Concepts
Рет қаралды 67 М.
Flutter SQFLITE CRUD Operations
28:36
dbestech
Рет қаралды 66 М.
Turns out REST APIs weren't the answer (and that's OK!)
10:38
Dylan Beattie
Рет қаралды 143 М.
Flutter Getx BLoc and Riverpod App
8:30
dbestech
Рет қаралды 23 М.
BLoC Pattern with Flutter || State Management
22:50
CodeX
Рет қаралды 95 М.
#googleflutter  Cubit Vs Bloc - Flutter Bloc Tutorial
10:40
Mobile Programmer
Рет қаралды 2,5 М.