Flutter: Firebase CRUD Using Cloud Firestore | BLoC Refactoring

  Рет қаралды 18,233

Robert Brunhage

Robert Brunhage

Күн бұрын

Пікірлер: 60
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
Have had many requests on making a video without BLoC and one with so here is some refactoring on how to make last weeks CRUD Firestore video into a BLoC CRUD with Firestore! Hope you enjoy :)
@leonardoventocilla3275
@leonardoventocilla3275 5 жыл бұрын
YES !!!!! I´ve being waiting for this for a long time. I stoped all my projects/studies to focus on this. Thanks for the tutorial ..
@em3888
@em3888 5 жыл бұрын
Great, Can we do BLoC + Firestore + Google Login + Email Login? I am looking for a best practice for a while
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
@@leonardoventocilla3275 Haha awesome, happy I could help and thanks for the support! :)
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
@@em3888 Something I am looking to do in the future, it's quite a long/complicated video to make but will do my best :)
@brennanconner171
@brennanconner171 3 жыл бұрын
Instablaster.
@jadoooh55
@jadoooh55 5 жыл бұрын
Thanx for teaching us how to copy Paste
@yanischetouani7392
@yanischetouani7392 3 жыл бұрын
whay you did not use Bloc event and bloc state ?
@ptflag
@ptflag 5 жыл бұрын
which previous video are you refering to?
@LexPrimost
@LexPrimost 5 жыл бұрын
Hi i want to use multiple bloc for differents page. How do that with your method ? Since the bloc_provider in the main.dart only takes one bloc as a child what is the proper way to do that. I am aware of flutter_bloc package wich have an option to group blocs but your way of creating blocs is much more understandable and clear. Let me know. thanks again
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
There are two main ways. The first one is just that if you want another top widget BLoC just wrap another BlocProvider. The other one is to have a "AppBloc" which the other bloc is created in with getters. I have a post on my patreon explaining the latter one and linking to a medium post from David Anaya: www.patreon.com/posts/26189310 The post should be public :)
@LexPrimost
@LexPrimost 5 жыл бұрын
@@RobertBrunhage thank you i appreciate !
@LawZist
@LawZist 5 жыл бұрын
great video! do you think BLOC is the way to go then redux for flutter ?
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
I still believe in the vague answer of it depends. I personally like using BLoC as it gets pretty straight forward when you get through the basic concepts i.e the points I made in the BLoC tutorial series on. But I believe Redux is a great way especially if you are doing web development also.
@mustafadarwesh9108
@mustafadarwesh9108 5 жыл бұрын
Great content!!
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
Thanks, happy it helped! :)
@bremington2010
@bremington2010 5 жыл бұрын
I am not clear on how many streams to create for an application. My app is using a single database from SQFLITE and also storing some values in shared preferences. SQFLITE has 5 tables. Do I create a single stream for SQFLITE and one for Shared preferences? Do I create a stream per Table? Thank you!!
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
That all depends on how you want to handle your data. For example I have 4 tables in my app which all has something to do about the user. It may be a User table that has a connection to a table of friends. Now what I would do is take the data from the table, put that in a class or multiple then stream out the data the way I want it. So it may be 1 Stream for all the data as it is in one class or it may be 5 streams as all the data is independent. Hope that makes sense :)
@KhainiSader
@KhainiSader 5 жыл бұрын
Can you monitor your firestore usage? On opening an app(starting it up), does your firestore redownload the documents that are being displayed?
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
You can monitor your usage of Firestore in the console by going to Database and then usage :) A bit unsure about the redownloading so maybe a question for the Firebase support.
@KhainiSader
@KhainiSader 5 жыл бұрын
​@@RobertBrunhage Can you look at your firestore usage in the console? Is it charging reads, lets say the data has not changed and you open the app after 30 minutes(app is closed for more than 30 minutes)? Thank you!
@randomone6143
@randomone6143 5 жыл бұрын
LOVE YOU ♥
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
Happy to help! :D
@ricksondpenha
@ricksondpenha 5 жыл бұрын
Awesome.. more videos please.😍
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
Thanks for the support!
@oracletrading3000
@oracletrading3000 5 жыл бұрын
How did you wrap your widget with streamBuilder via context menu? I didn't find with with default dart code extension
@lovefrommemee5710
@lovefrommemee5710 5 жыл бұрын
Alt+Enter or if in vscode right-click on a widget n press "Refactor".
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
Didn't actually notice when I got this. Can be because I am sitting in the dev branch, maybe? Before I had this I used "Awesome Flutter Snippets" for visual studio code, to get the short command stb to build a StreamBuilder!
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
@@lovefrommemee5710 Can also ctrl + "." in VS code 🔥
@Kodeversitas
@Kodeversitas 5 жыл бұрын
OK got it, it just my extension is outdated
@nicolapigozzo5188
@nicolapigozzo5188 5 жыл бұрын
Is possible for you to make video about checking memory usage? I like the tools we have on android studio
@LexPrimost
@LexPrimost 5 жыл бұрын
Hi thank you for this one too. Can you lead me to the tutorial about bloc provider which you mentioned before using the bloc provider file?
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
Here is the part where I implement the BlocProvider kzbin.info/www/bejne/h5-koHiMarqll6s Here is the code from it which you can just copy and paste: github.com/RobertBrunhage/KZbin-Tutorials/blob/master/bloc_pattern_tutorial/lib/widgets/bloc_provider.dart
@LexPrimost
@LexPrimost 5 жыл бұрын
@@RobertBrunhage thank you appreciate that
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
@@LexPrimost Happy to help! :)
@argigentarna
@argigentarna 5 жыл бұрын
Really nice tutorial, i hope you create other study case with bloc, like whatsapp clone, uber clone, or the others..
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
Thinking of doing something like this is the future but still unsure, We will have to see :)
@mrpakravian
@mrpakravian 5 жыл бұрын
You are the best💫💫💫💫💫💫💫💫
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
Thanks for the positivity, love reading this in the morning!
@mrpakravian
@mrpakravian 5 жыл бұрын
Robert Brunhage you deserve it for your quality stuff
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
@@mrpakravian Glad you enjoyed it, trying my best to increase the quality for each video!
@nxgwarrior
@nxgwarrior 5 жыл бұрын
Thanks for this tutorial, can you make a video on ecommerce, (specially shopping cart)
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
We will see! :)
@josephjoey3904
@josephjoey3904 4 жыл бұрын
@@RobertBrunhage Almost a year now, haven't seen :(
@azadcoder8682
@azadcoder8682 3 жыл бұрын
Thanks for github link
@randomone6143
@randomone6143 5 жыл бұрын
could you do a video with php and mysql/SqlServer implementation ?
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
Something I would love to do, sadly I haven't had time to learn this myself so this one will take a while... :/
@Trancecend
@Trancecend 5 жыл бұрын
A million tutorials out there about that. Php is old, so lots of resources exist.
@hambaadsense3506
@hambaadsense3506 5 жыл бұрын
I thinks this one fit for you: kzbin.info/www/bejne/i5aQgYCFbrmfe80
@nmgbjh
@nmgbjh 5 жыл бұрын
it not real time ????
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
What do you mean?
@nmgbjh
@nmgbjh 5 жыл бұрын
@@RobertBrunhage I want to get realtime data ,but When I use this method, it doesn't work !! plz helps me
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
@@nmgbjh Hmm that is weird. The whole point of this is to listen to a collection to get realtime updates. With the init function we say that the data from Firestore should flow to our bloc and that will then be added to our stream which is displayed in the UI :/
@nmgbjh
@nmgbjh 5 жыл бұрын
@@RobertBrunhage yes ! I have tried every way I can @@ but it does not work @@ it does not listen to the data
@RobertBrunhage
@RobertBrunhage 5 жыл бұрын
@@nmgbjh And you can see it updates in the Firestore Console?
This is my approach to state management in Flutter
4:47
Robert Brunhage
Рет қаралды 3,4 М.
Flutter: Firebase CRUD Using Cloud Firestore
10:53
Robert Brunhage
Рет қаралды 34 М.
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 102 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 15 МЛН
Lamborghini vs Smoke 😱
00:38
Topper Guild
Рет қаралды 22 МЛН
Flutter State Management - The Grand Tour
14:07
Fireship
Рет қаралды 246 М.
Flutter Provider - Advanced Firebase Data Management
11:08
Fireship
Рет қаралды 144 М.
Flutter BLoC Library Tutorial - Simple BLoC Pattern Solution
15:42
Using Firestore as a backend to your Flutter app
11:42
Google for Developers
Рет қаралды 526 М.
The Price of Using Local Packages in Flutter
6:41
Robert Brunhage
Рет қаралды 8 М.
Flutter: BLoC Pattern Episode 1 | Streams
11:14
Robert Brunhage
Рет қаралды 29 М.
My favorite testing approach in Flutter
3:35
Robert Brunhage
Рет қаралды 1,9 М.
List Detail with Cloud Firestore in Flutter
16:00
Samarth Agarwal
Рет қаралды 65 М.
Flutter - Firestore CRUD (Reading and writing)
21:56
Raja Yogan
Рет қаралды 45 М.
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 102 МЛН