Тёмный

Flutter Provider - Advanced Firebase Data Management 

Fireship
Подписаться 3,2 млн
Просмотров 144 тыс.
50% 1

Learn how to use the Provider package to simplify data flow in your #flutter app and react to #firebase realtime streams across the entire widget tree. fireship.io/lessons/advanced-...
Provider pub.dev/packages/provider
FlutterFire github.com/flutter/plugins/bl...
Enroll in Flutter Firebase - The Full Course
fireship.io/courses/flutter-f...
Take $10 💸 off a PRO membership with code: b9uf1v4U

Наука

Опубликовано:

 

4 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 162   
@vtitsboti9815
@vtitsboti9815 3 года назад
Can you pretty please make an updated version of this video? :)
@samuelnihoul3159
@samuelnihoul3159 2 года назад
Yes, it's unclear how to setup the StreamProvider now :( It requires a value and an initial data but what do we put in initial data?
@NickFehlinger
@NickFehlinger Год назад
@@samuelnihoul3159 You can put null in the initial data if there isn't cached data you want to load on init. Especially for authentication you want it to return null unless there is a logged in user.
@degonar3528
@degonar3528 2 года назад
This way of teaching (presenting a problem and solution) about something like a third-party package is SO good. I hate it when tutorials just throw stuff and say "use it" and don't explain why can't I just use built-in stuff, which is often much easier to understand as a beginner. Thank you!
@ManOnTheMoon2131
@ManOnTheMoon2131 3 года назад
This was a great tutorial! Given its success, I think you should definitely come out with an updated version! Almost everything is outdated and/or deprecated.
@iamfirdous
@iamfirdous 3 года назад
Please make an updated version of this video. BTW, I love all your videos, they are crisp and clear, and you are always straight to the point.
@philippdice9483
@philippdice9483 4 года назад
Thank you so much! You have such a nice way to write clean code eventhough some things getting quite complex! You helped me alot and I was able to save a lot of boiler plate code!
@joshuanovak919
@joshuanovak919 5 лет назад
"Beer. Temporary solution." - If i wasn't already subscribed that would make me subscribe right there lol
@luisponce3580
@luisponce3580 4 года назад
Im in the 7:07 minute mark and i stopped the video just to say that this video is very awesome!! I didnt know that there was the spread operator, good stuff!! Amazing video so far
@blessingchelinje9317
@blessingchelinje9317 5 лет назад
So far the best tutorial to learn the provider. 1000Likes from me
@JohnEGledhill
@JohnEGledhill 5 лет назад
Excellent timing with suggesting Provider ... since at Google IO 2019 that is what was recommended. You got skillz.
@TwistedDestroyer99
@TwistedDestroyer99 4 года назад
Does provider work with BLOC, or is that an alternative approach?
@Lensbreak
@Lensbreak 3 года назад
@@TwistedDestroyer99 good question, anyone has answers?
@akhan2501
@akhan2501 4 года назад
I promise to buy the advance course, as the basic intros have helped me land jobs in flutter
@crossmetz1372
@crossmetz1372 5 лет назад
I was just watching google I/O about provider and boom , you post this
@storylineteam
@storylineteam 4 года назад
As a game development company, trying to get to the app dev zone for our clients, we find your channel great! Coming from a .Net background angdbeing a small company, we decided to use Dart and flutter, mainly for the great merging of Composition ant OOP. .. Please Conceder on doing a video about end 2 end encryption on firestore data, as this is the most important not covered topic out there... and apis like Virgil are too expensive for small companies and individual devs and using user password as a encryption key prevents the data to persiston password changes. Here in Europe, with new personal data laws, firestore is useless without the ability to encrypt data. Continue your great job!All the best from Greece!
@SilasSWF
@SilasSWF 5 лет назад
Excellent tutorial. Thank you!
@newtonmunene
@newtonmunene 5 лет назад
Wow, that factory Class.fromMap trick is totally awesome. I can't believe I've been struggling to create classes from maps All this time
@oztech
@oztech 5 лет назад
I know we need this, but is there any way we can automatically deserialize from map to object?
@ssokurenko
@ssokurenko 5 лет назад
Top quality content! thanks Jeff
@Fireship
@Fireship 5 лет назад
Thank you Sergey
@ShashankMSuresh
@ShashankMSuresh 4 года назад
Ma name a jeff! 🤣🤣🤣 #22jumpstreet
@MultiTelefono
@MultiTelefono 3 года назад
I love the last tip!!
@seunghwanjeong5348
@seunghwanjeong5348 5 лет назад
so amazing !! this is what I was waiting for thank you !! :)
@motta021
@motta021 5 лет назад
Thank you Jeff. I love your videos.
@braindongle
@braindongle 4 года назад
This knowledge share is pretty incredible. Getting started with Flutter is easy, but the "ok, I'm going to build a real app" part is still evolving to say the least. Choosing a state mgt and dependency injection solution is coming along (Thank you Remi Rousselet!). But how does one approach client-server communication in a real-world app that uses Firebase? Where is your source of truth for the data model? Where do you keep global state? ...and on and on. So many questions. Great answers here.
@basheeral-momani2032
@basheeral-momani2032 2 года назад
That's awesome thanks for sharing this part,
@mawulijo
@mawulijo 5 лет назад
The gif in the intro keeps distracting me. hahahahahaha. Now I can write less code for the same results. Very grateful Sir Jeff.
@Anstroy95
@Anstroy95 4 года назад
Thanks a lot for the explanation, I want to be like you one day 💪
@drdDavi
@drdDavi 5 лет назад
You are a fast talker and alway paste the code instead of typing. But your videos are absolutely informative and clear! This one was especially helpful to me! Keep up the good work man! Flutter && VueJS && Firebase all the way.
@leofonseca8144
@leofonseca8144 5 лет назад
you can slow down the video to 25%. then watch it at 50% then at full speed. typing wastes time. Im just grateful his english is crystal clear, as the subject matter already demands your full attention. a lot of other fluffer channels fail miserably at this.
@jaydanu
@jaydanu 5 лет назад
Hey can you share which VS Code Theme are you using? I can't seem to find the exact same one and I like the color scheme, it's easy on the eyes and the contrast is good.
@fawazjoseph878
@fawazjoseph878 4 года назад
Thank you for this video. It really helped me solved a big problem with my app
@Fireship
@Fireship 4 года назад
Glad to hear that, provider solved many of my problems
@emmanuelogbewe2334
@emmanuelogbewe2334 5 лет назад
Great vid!!
@JayPerf
@JayPerf 5 лет назад
holy crap this is a good one hahah you are the best Firebase resource on the web dude, and the flutter stuff is also the best out there
@Fireship
@Fireship 5 лет назад
Thank you Jason!
@JayPerf
@JayPerf 5 лет назад
@@Fireship Seriously, I was about to head down the nested widget stream road you talk about, and this video was a revelation for solving that issue. I worked through your Firestore/Angular series before discovering your stuff on Flutter and started to try to teach myself that, and this is by *far* the most comprehensive "advanced concepts" channel out there
@danchatka8613
@danchatka8613 4 года назад
Thank you for your great tutorials. It would be nice if you had a simpler introduction to Flutter Provider. It would be very similar to this tutorial, except: a) Don't base the tutorial needing a server-side resources. Maybe reading a local config file would be a simpler way to get params that are needed by different widgets in the app; b) skip discussion of other Flutter state management techniques or their history. That topic is better suited for an update to your Flutter state management Grand Tour tutorial.
@Blues_unicat
@Blues_unicat 5 лет назад
You are hero of flutter-er
@saifhakeam8599
@saifhakeam8599 5 лет назад
YOU SIR..... are a legend
@lyseihakh
@lyseihakh 4 года назад
Wow so good content. thank you
@fpsColton
@fpsColton 4 года назад
When you setup your StreamProvider with the onAuthStateChanged, I notice that for a brief moment during the app's startup, that the value provided is null. How can you implement a loading page to appear when you only have null or not null to test with in the child widgets?
@lukaszs9648
@lukaszs9648 4 года назад
Love it!
@RobertBrunhage
@RobertBrunhage 5 лет назад
Great video, will have to check out Provider soon 🤔
@Fireship
@Fireship 5 лет назад
It's really underrated, I've been enjoying it!
@RobertBrunhage
@RobertBrunhage 5 лет назад
@@Fireship Using BLoC right now so that I can call a function from the BLoC to update other UI when data is updated in Firestore. Is this something that is possible with Provider? Edit: Using provider now and replaced the way I provide my BLoCs. Really cleans up the code!
@AR4U303
@AR4U303 4 года назад
@Robert Brunhage , what you mean? Using provider with bloc pattern??
@Lensbreak
@Lensbreak 3 года назад
@@RobertBrunhage can you please elaborate a bit?
@anderslovbrand
@anderslovbrand 4 года назад
I enjoy and use many of your patterns! However when abstracting with Collection , how can I pass arguments that makes me apply where- or orderBy-rules?
@user-fh4xo2pc2d
@user-fh4xo2pc2d 5 лет назад
Would you cover using other backend like node.js with flutter? Thank you for all the flutter tutorial. I'm buying your course!
@Fireship
@Fireship 5 лет назад
Yes I would consider that. Dart has a good HTTP package and I've also been thinking about a graphql vid for other backends.
@aislanarislou
@aislanarislou 5 лет назад
@@Fireship Graphql would be awesome!
@raul286162
@raul286162 5 лет назад
Node plz also would like golang
@danhemingway5780
@danhemingway5780 3 года назад
Great video. Quick question, is it possible to run calculations using a StreamBuilder as a class and then access the output of those calculations as Provider? Rather than run the repeat calculations at each required part of the app.
@tirupatirao7521
@tirupatirao7521 4 года назад
Peak Video tutorial for flutter
@derrickawuah9477
@derrickawuah9477 5 лет назад
Great video Jeff! I definitely like this better than Bloc for my use cases. Do you plan on covering Flutter testing in the future?
@Fireship
@Fireship 5 лет назад
Yes, testing in one my video list, but no exact timeline yet...
@JochemToolenaar
@JochemToolenaar 5 лет назад
Awesomeness!
@SafdarAliShah_TimeTraveler
@SafdarAliShah_TimeTraveler 5 лет назад
i will be the luckiest guy to work with you on flutter and i m Sure that will be everything to learn everything...
@josehmoller2059
@josehmoller2059 3 года назад
que buena chamba compañero. good
@kevinbenhoff3560
@kevinbenhoff3560 4 года назад
Would you say that StreamProvider is a resource expensive way to manage state as compare to say ChangeNotifierProvider? In your example you listen to a User stream which is cool because if anything is changed in Firestore it is immediately updated in the app. However, this seems to me like it would be a fairly resource intensive (battery, wifi, data xfer) way listening to the database for changes that may not really be all the frequent. Should StreamProvider with regards to data in Firestore be reserved for things that require instant updates (like notifications for example) while data that doesn't change too often be handled by ChangeNotifierProvider. Thoughts?
@kiranjisac4745
@kiranjisac4745 4 года назад
Hi What to do when stream provider is called on null when The. Collection is not created yet
@eduardogthiesen
@eduardogthiesen 4 года назад
Great video! I was wondering though, if, let's say I have 1000 documents in a collection, for each time I call Provider.of in a new screen Firebase will count it as 1000 reads?
@storylineteam
@storylineteam 4 года назад
I have a question about listening to firebase changes via streams... Is it possible this approach to be more expensive than implementing some time based or manual refresh method? Especially on apps with a large userbase? I mean, if a user remains for a long time to the same page that makes the dispose method useless..
@Hell2Night
@Hell2Night 5 лет назад
I learn about this package in the Pragmatic state management session of the Google IO. This is great, now, I don't see the point to use such things as BloC for state management. Provider make it easier, and reduce boilerplate.
@Fireship
@Fireship 5 лет назад
That was a good talk. I like the flexibility of Provider and you can even use it to roll out your own Bloc-style solutions.
@lwasinamdilli
@lwasinamdilli 2 года назад
please make an updated version...... A must watch for flutter developers
@0x4ym4n
@0x4ym4n 5 лет назад
Great!
@shashankrewankar2838
@shashankrewankar2838 3 года назад
stream provider asks for 'initialData', when I hot restart, the child widgets take the 'initialData' instead of the most recent data from the stream. I want it to take the most recent data instead of the value given in InitialData. Anyone knows how I can do that?
@kameshvadivel9459
@kameshvadivel9459 4 года назад
Sir,I am using grid view builder to load images from friestore, when I scroll down images are again loading, I also tried cached network image but it not worked,how to solve this problem?? Can you help me??
@vidy1983
@vidy1983 3 года назад
can you explain the difference between the streamprovider and streamprovider.value constructors? its hard to find anywhere.
@muhammadchhota4463
@muhammadchhota4463 5 лет назад
Is multi provider share data between multiple pages?
@rutayisirewilly1217
@rutayisirewilly1217 4 года назад
Hello could you tell me if possible how to handle errors in stream provider. thnks
@immathiasyde
@immathiasyde 3 года назад
How can you use the Realtime Database instead of Firestore?
@peekpt
@peekpt 5 лет назад
I've been playing with provider, seems to be the next thing
@YuppinYanni
@YuppinYanni 5 лет назад
Are you coming out with a Flutter for beginners course soon or just the Flutter Firebase course for now?
@parwandaha3091
@parwandaha3091 4 года назад
I still cant make the connection between the user, superhero and weapons. where did the users come in the picture?
@aislanarislou
@aislanarislou 5 лет назад
Hey @Fireship, Do you think Cloud Firebase is capable of replace an database architecture composed with some tables (I'm using Postgres) that have many-to-many relationships? Those relationships frequently have many-to-many between 3 tables.
@Fireship
@Fireship 5 лет назад
It's probably possible, but might not be practical. Sometimes it's better to duplicate or partially migrate the data you want in Firebase. Every case is different.
@feutioclide7345
@feutioclide7345 3 года назад
How can i Provide 2 streams in the MultiProvider array with one dependent on the other?
@E-Hub_01
@E-Hub_01 4 года назад
simple but implementation is very complex.
@quirky_hehe
@quirky_hehe 5 лет назад
Is there an option to buy the flutter course alone without a subscription?
@oliverbytes
@oliverbytes 4 года назад
What if the Firebase User changes it's display name suddenly.. will it be updated automatically by the Stream or you'll have to manually refresh the FirebaseUser?
@Lensbreak
@Lensbreak 3 года назад
good question. did you figure out?
@oliverbytes
@oliverbytes 3 года назад
@@Lensbreak yes I did :)
@maximilianystalloyd6610
@maximilianystalloyd6610 4 года назад
How can you update the data from a widget that uses Provider.of?
@antonivanov5751
@antonivanov5751 5 лет назад
Thank you very much for your videos. Could you answer - what's the font in your VS Code that you use?
@deneb6139
@deneb6139 3 года назад
I think it is "Fira Code".
@edbienes
@edbienes 5 лет назад
Please cover svelte and firestore :)
@RoughSubset
@RoughSubset 5 лет назад
Hey Jeff, how do you get those emojies in your IDE and in Firestore?
@Fireship
@Fireship 5 лет назад
They are actually just strings so you can simply copy/paste them emojipedia.org/
@politicallynotcorrect2968
@politicallynotcorrect2968 4 года назад
Can you talk about more in depth on all the providers options like providers stream ect...
@felixo9234
@felixo9234 5 лет назад
Flutterfire 🦄
@nested9301
@nested9301 3 года назад
why we using the factory consturctor why not a simple function?
@RudeboyJackson
@RudeboyJackson 5 лет назад
I'm trying to implement this, but getting the following error at this line: StreamProvider.value Error: "The class 'StreamProvider' doesn't have a constructor named 'value'." Could someone possibly explain what I'm doing wrong? Will really appreciate it!
@RudeboyJackson
@RudeboyJackson 5 лет назад
Ah, had to update the Provider package
@BeastinlosersHD
@BeastinlosersHD 4 года назад
When putting your StreamBuilders inside of providers: [] in MyApp, change it from stuff(lazy to type it).value(stream: FirebaseAuth.instance.onAuthStateChange) to stuff(lazy to type it).value(value: FirebaseAuth.instance.onAuthStateChange) This is because when provider moved to v3 they broke a bunch of stuff from the previous version. You can look into it in more detail on their Github repo's readme
@maelstromgames5832
@maelstromgames5832 3 года назад
you are a god, was trying to figure out what the deal was
@Mohamedhassan-if8ww
@Mohamedhassan-if8ww 5 лет назад
Can i ask you something . how does the WeaponList find the weapons weapons = Provider.of(context); and you didnt evil put that stream in the multi provider
@gmmkkgmmkk6168
@gmmkkgmmkk6168 5 лет назад
I am confused also did you find solution?
@Mohamedhassan-if8ww
@Mohamedhassan-if8ww 5 лет назад
@@gmmkkgmmkk6168 No just waiting for his answer maybe he can explain how the cycle goes or we are missing something
@gmmkkgmmkk6168
@gmmkkgmmkk6168 5 лет назад
What is your email?
@ethanzhang8932
@ethanzhang8932 5 лет назад
just curious what plugins are you using in the VS code editor, they are looks awesome, could you share the plugins?
@Fireship
@Fireship 5 лет назад
I will make a video that reveals all this stuff very soon :)
@VishalDesai711
@VishalDesai711 5 лет назад
what is factory return type in SuperHero?
@ddean3732
@ddean3732 4 года назад
Great vid. I have a question... Can I contact you directly?
@Juliapak
@Juliapak 2 года назад
Hmm I just created some classes to feed the data from firebase firestore to my widgets
@happynewyearw
@happynewyearw 5 лет назад
But isn’t provider still highly tied business logic with widget tree? For example, when we have to put widget in the child of Multiprovider? When the app scale up or we have to move widget and functionally around, there’s still a lot of refactoring to do, unless we put the multiprovider at the very top of the widget tree?
@Fireship
@Fireship 5 лет назад
That is true, but you need some way to tell the framework where its data dependencies are located. I think Provider does this in a way the fits the ergonomics of Flutter well.
@jonathankumar2052
@jonathankumar2052 5 лет назад
Can you update this or the blog post to v3 of provider, there are some subtle differences such as different parameter names and etc.
@ChristianJosephs
@ChristianJosephs 5 лет назад
@fireship this is a real thing. The syntax changed with the update and the blogpost isn't up-to-date anymore. I think that can be fixed within 10min work?
@jonathankumar2052
@jonathankumar2052 5 лет назад
@@ChristianJosephs agreed, its completely different, although the readme does guide you through the transition, it could be a bit confusing for flutter/dart beginners @fireship please try to fix this.
@doodies1234
@doodies1234 5 лет назад
hey! any thoughts on fish redux?
@chinmayagarnaik6458
@chinmayagarnaik6458 4 года назад
Please can you make a video on how to retrieve double value or geo point from firebase
@carlospedroza7114
@carlospedroza7114 5 лет назад
Awesome tips and tricks! Keep the good work! There is a new version of the library (now 3.0.0) at pub.dev/packages/provider, and Provider now throws if used with a Listenable or a Stream. We can disable it with Provider.debugCheckInvalidValueType = null;
@adebajooluwaseyi2124
@adebajooluwaseyi2124 4 года назад
one year and still here
@rajdave9862
@rajdave9862 4 года назад
Please tell, from where you are learning all of these because I am not able to learn from docs. So please tell us your sources to learn?!
@yvesboutellier336
@yvesboutellier336 2 года назад
please do this video again but with riverpod
@victornweze7230
@victornweze7230 5 лет назад
boom
@kotivideos7140
@kotivideos7140 5 лет назад
what you prefer to use? provider or rxdart ?
@Fireship
@Fireship 5 лет назад
They serve different purposes, I actually use provider in combination with RxDart. Rx is useful when you need specialized control flow over the stream itself.
@tarunblaze
@tarunblaze 4 года назад
How do I Implement my isEmailVerified using provider
@abhishekbutola8294
@abhishekbutola8294 5 лет назад
What if streamHero returns null? I am getting error on model file. The methos '[ ]' was called on null
@abhishekbutola8294
@abhishekbutola8294 5 лет назад
nvm figured it out
@abhishekbutola8294
@abhishekbutola8294 5 лет назад
What i did was return the .forMap() with default values Map but the problem is that first I am getting the error screen showing null then its rerendering the default values instantly.
@ixGeneralz
@ixGeneralz 3 года назад
can we have a vidoe for many-to-many relationships using this logic?? thanks
@pubgkillers4537
@pubgkillers4537 4 года назад
The method 'map' was called on null. Receiver: null Tried calling: map(Closure: (Weapon) => Card) This is the error that i am getting when trying to use your tutorial. Please helpp.
@vinceramcesoliveros6739
@vinceramcesoliveros6739 4 года назад
Timestamp from this video?
@flutterkhouse7498
@flutterkhouse7498 5 лет назад
What's the intro song's name?
@oztech
@oztech 5 лет назад
I refactored my code from using Redux to BlocProvider and now I need to refactor again with Provider :-) ha.. but the Provider seems better than my current solution,,, only if it scales well.
@oztech
@oztech 5 лет назад
wait.. how do you change the value (state)?
@Lensbreak
@Lensbreak 3 года назад
BLOC or PROVIDER ? what is better in 2021?
@AbdulMunim-kx6np
@AbdulMunim-kx6np 3 года назад
For me it's provider
@AbdulMunim-kx6np
@AbdulMunim-kx6np 3 года назад
Because i only.know that not the bloc pattern
@fuser312
@fuser312 3 года назад
Provider is definitely better and easier but a lot of recruiters are looking for developers with BLOC experience
@jaigohil4963
@jaigohil4963 5 лет назад
@Fireship can you make a video flutter app deployment both on ios and android? And other lisencing stuff that goes with it!
@Fireship
@Fireship 5 лет назад
I may do that in the future, but I cover the deploy process in the full course for both google play and apple.
@andreafeletto
@andreafeletto 4 года назад
You never know the knowledge you will need in the future... For example I could have never thought than knowing the channel milleaccendini would have helped me with flutter development.
@darkchoclate
@darkchoclate 2 года назад
wow... it's interesting to see how dart has changed dramatically in last Frew years... Now it always Buggs me to add const modifier and null check...
@erperejildo
@erperejildo 4 года назад
3:42 what's that extension called?
@beloArgentina
@beloArgentina 4 года назад
For enable that ide menu? It's just VS Code with Flutter and Dart extensions
@TimeoutMegagameplays
@TimeoutMegagameplays 5 лет назад
I still don't get all those state management providers, why not only use a StreamBuilder? You have to write lots more to code to achieve the same result with the other solutions.
@Fireship
@Fireship 5 лет назад
Provider does not require extra boilerplate. It's actually less code than StreamBuilder (in fact, its syntactic sugar for it) because it manages the subscriptions for you, so you can treat the emitted value as if it were synchronous
@TimeoutMegagameplays
@TimeoutMegagameplays 5 лет назад
​ Fireship ​Oh I didn't catch that synchronous thing, that is actually pretty useful stuff.
@willielassiter
@willielassiter 4 года назад
In your "Flutter" playlist, videos 8, 9 and 10 look to all be the same: "Flutter Provider - Advanced Firebase Data Management". you might want to take a look at that and clean it up if i'm right... or not....
Далее
Flutter Provider Simply Explained
9:08
Просмотров 88 тыс.
Наташа Кампуш. 3096 дней в плену.
00:58
Why The Olympics Banned Nike
9:57
Просмотров 266 тыс.
Flutter Provider EASY Tutorial
9:43
Просмотров 46 тыс.
80% of programmers are NOT happy… why?
4:43
Просмотров 1,1 млн
Flutter Provider Package In Depth - StreamProvider
44:16
Top 12 Flutter Tips & Tricks
9:32
Просмотров 267 тыс.
Zuck's new Llama is a beast
4:13
Просмотров 1,3 млн
Using Firestore as a backend to your Flutter app
11:42
Просмотров 523 тыс.