Тёмный

Pragmatic State Management Using Provider (The Boring Flutter Development Show, Ep. 24) 

Flutter
Подписаться 573 тыс.
Просмотров 70 тыс.
50% 1

In this episode, Filip and Matt go over the Provider package, a straightforward way to manage state in a Flutter app. Watch the pair swap out BLoC with Provider in the Hacker News Flutter app.
Provider Package → goo.gle/2YnDeVD
Pragmatic State Management in Flutter (Google I/O'19): → goo.gle/2XKlVBb
Watch more episodes of the Boring Show here → goo.gle/BoringFlutterShow
Get started with Flutter → flutter.dev
Learn more about the Dart Language → goo.gle/2YF9OCi
Try a Flutter codelab → goo.gl/d3fHPo
Join the conversation → goo.gl/68oUnb
Subscribe to the Flutter channel → goo.gle/Flutter
#Flutter #BoringShow #AppDevelopment

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

 

2 июл 2019

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 125   
@WikiPeoples
@WikiPeoples 5 лет назад
I love this show. 1) I am able to learn a lot while watching it. The context you get from watching you guys think about why/when to use a certain technique is really valuable and you don't get that in little snippet videos. 2) It's really reassuring to see you guys actually have to "think" about what to use. In the world of hyper-editted videos, it's easy for someone to come off as having zero struggle or thought process. Seeing you guys take a pause to consider the implementation is a nice reflection of the reality of programming - we're not just typing hundreds of lines of code every minute, flawlessly slamming out the perfect implementation.
@easyflamer
@easyflamer 5 лет назад
I'd love for there to be another Boring Show with working on provider from scratch
@josecoverlessons
@josecoverlessons 4 года назад
same
@poongkv123
@poongkv123 4 года назад
same +1
@bazilangullia6494
@bazilangullia6494 4 года назад
yup
@michaelappiah-kubi2829
@michaelappiah-kubi2829 3 года назад
Yeah
@aseemsharma4643
@aseemsharma4643 3 года назад
Same +1
@vkhooda24
@vkhooda24 4 года назад
That's exactly what I was looking for where refactor code having bloc pattern to provider pattern. It's really a very nice vblog on state management using provider. Though it names boring flutter development, in actual it was very interesting and I really enjoyed it. There was much learning along with the provider implementation. Thank you Flutter team, of course, Matt and Filip.
@mikeyinger4204
@mikeyinger4204 2 года назад
This stands the test of time. I laughed out loud a lot, especially in the beginning. Thanks for just wading into it and demonstrating good coding practice during realtime refactoring. I came here because my page keeps getting the MyApp's MaterialApp's context and then can't see the Providers that reside lower in the tree. Anyway, now I'm gonna watch it again.
@sarusethi987654321
@sarusethi987654321 5 лет назад
Please do a show on State Management again. This was not informative at all. Demonstration of any architecture with an app that has 1-2 screens is easy. But how will the architecture scale in medium to large scale apps. We would love to hear what architecture solutions are used by big apps such as Google Ads, Hamilton, Reflectly etc.
@dangggdennis
@dangggdennis 5 лет назад
I agree that seeing some deep examples would be helpful, but paradigms and architecture that work for large scale apps may often be overkill for small to medium scale apps. But hey, not saying your app isn’t large scale.
@1234zaptor
@1234zaptor 3 года назад
@@hoodedferret can u provide a link?.
@markusmcgee
@markusmcgee 4 года назад
Good paired programming. Need more videos like this. Off the cuff and trying to fix things on the fly.
@sadabwasim9850
@sadabwasim9850 5 лет назад
Best episode so far, loved it
@MitchellWongHo
@MitchellWongHo 5 лет назад
Apart from the excellent content, I ❤️ Matt's t-shirt
@tripathiabhay1
@tripathiabhay1 4 года назад
Having some friendship with RxJs and RxJava, This episode was an interesting one to me among many others. You guys are great. One Request - Please create an another episode on providers for medium to large application from scratch with some detailed info on it.
@SreekanthKrishnan
@SreekanthKrishnan 5 лет назад
Thanks for such a boring show 😆. Have been waiting for this topic. Hope you'll continue on this in next episode. I think you guys should try live boring show so that we can also participate.
@michelonwordi3202
@michelonwordi3202 5 лет назад
I need that dart t-shirt Matt's rockin.
@Mohamedhassan-if8ww
@Mohamedhassan-if8ww 5 лет назад
the best show ever . better than netflix
@EricBichara
@EricBichara 5 лет назад
Very informative!
@onetdev
@onetdev 5 лет назад
I love to see you guys struggle as much as I do (as a flutter newbie).
@filiphracek
@filiphracek 5 лет назад
Software development is hard (like most things that are worth doing, imho). Glad this show is useful to you! Once you're expert, please don't forget to give back - show the next wave of newbies that even when you're expert, these things can be hard, and that's okay. Cheers!
@82invisinle82
@82invisinle82 5 лет назад
Great video about Provider. I have a question in my mind though. I would be happy if you can help me to understand some point. I have an app and I am using provider to handle the authentication. I wrapped my MaterialApp with ChangeNotifierProvider. Apart from that I have an Auth class that extends ChangeNotifier and I notify the listeners after the user is logged in or I check if there is a current user(local storage) in the constructor. Depending on the user state I return appropriate widget(Login screen, main screen etc.) It works perfectly but when I use Navigator to push new routes, The ChangeNotifier builder part where I wrapped MaterialApp rebuilds everytime even there is no change with the data. I am not calling notifyListeners either. So I dont't understand why pushing new routes triggers that part. To give an example I have a widget in the main screen with a FutureBuilder which returns a list. When I click to a list item it pushes to a detail view. When I go back, it rebuilds the previous widget so FutureBuilder is fired again. I assume it is rebuild because it is a descendent of MaterialApp and that part is being rebuild causes my main screen to rebuild too.
@peterphillip99
@peterphillip99 5 лет назад
Watched your conference guys, and that was great. I used provider on my app. It was simple to implement and made so much sense. Looking forward to watching this one
@TienHuynh5312
@TienHuynh5312 5 лет назад
Can you update the documentation on use cases of different providers?
@chrisodonnell86
@chrisodonnell86 5 лет назад
Hey with using StreamProvider.value, do you have an example of how to use the the "catchError" property, I can't find anything online besides the official documentation which I can't translate to a real world example. Help! :)
@2c7s
@2c7s 5 лет назад
It's not often that I feel so good after watching the notification for a "boring show".
@2c7s
@2c7s 5 лет назад
Once it was for the boring company.
@MinhTran-xn3kk
@MinhTran-xn3kk 5 лет назад
hi. should i create class called model to put data/vars into it to keep provider is simpler. look like MVP or MVVM ?
@rbp365
@rbp365 5 лет назад
that dart side T-shirt is kicking all kinds of asses
@martdingley
@martdingley 5 лет назад
Great show guys, full of laughs 😂
@kojoprempeh
@kojoprempeh 5 лет назад
The much awaited show 💃🏽
@youkokaku
@youkokaku 5 лет назад
Please do an episode on local notification, and how the provider framework works when you try to tap on the notification pop up to open to a specific page. This would be very helpful!
@putinninovacuna8976
@putinninovacuna8976 5 лет назад
it's not boring but awesome we can learn alot about provider I wish I can code like u all
@flutterpiaui5662
@flutterpiaui5662 5 лет назад
uau amazing!!
@michelfeinstein
@michelfeinstein 5 лет назад
This Notifier reminds me A LOT an MVVM ViewModel from C#... How do they differ in architecture?
@TheDragonballpokemon
@TheDragonballpokemon 3 года назад
i have one question What is the overhead of sending a object down the stream so for example i have an application with arround 25 widgets Or arround 12 screens. i set the initial value at screen 3 and get and use the value at screen 10-12 The whole process of passing object from 3 to 10 using context will have some overhead What and how much exactly will be the overhead for moving 3 to 10 without using it once Thanks
@michelfeinstein
@michelfeinstein 5 лет назад
Why did you initialized the cache Map() in an initialization list at the constructor, and not at the field's declaration? It doesn't use anything from the constructor.
@amanshah2654
@amanshah2654 4 года назад
i really wanna know which is better this approach or bloc pattern for state mangement
@websky4241
@websky4241 5 лет назад
Make a movie about the 3.0 provider. There are many changes, for example ProxyProvider, how to use it and when. BTW nice video 😉
@sutechsdev
@sutechsdev 4 года назад
Hi there! I started Flutter with the provider and I'm pretty comfortable with this. But now my company is asking me to use BloC, but I really don't like BloC, and I'm getting a hard time working with the bloc. So should I use bloc or just say to my company that I can't use bloc. Please suggest should I use bloc or not.
@GuilhermeCarvalhoCarneiro
@GuilhermeCarvalhoCarneiro 4 года назад
Does the information proceed that the Provider should not be used in medium and large projects because of the limitation of ChangeNotifier in relation to the number of listiners that it can answer? Sorry for bad writing, I don't speak English
@marvinm6156
@marvinm6156 5 лет назад
How does the provider work in situations where i want to use Navigation-Routes? My Provider isn't there available anymore. How do i reach it there?
@marvinm6156
@marvinm6156 5 лет назад
OK i found a way by myself. One way ist to move up the Provider initizaltion above the Material App. More ways can be found here: github.com/rrousselGit/provider/issues/85
@a.k.m.saifulislam3891
@a.k.m.saifulislam3891 5 лет назад
I'd like to know which macbook model you're using as a flutter developer and how it's going on so far with you?
@oliverbytes
@oliverbytes 5 лет назад
Thanks guys!!! Officially switched to provider from scoped_model!! Thanks flutter team
@hadifromlebanon3812
@hadifromlebanon3812 4 года назад
When rapping the whole app with a ChangeNotifierProvider, and say for example a specific value that’s being displayed in a text changes, does the whole ui get rebuilt or only that specific textview?
@watchcrap1
@watchcrap1 4 года назад
No the listeners will be rebuilt. Wrapping the app with ChangeNotifierProvider just allows to you access the provider further down the widget tree, e.g. with the Provider.of(context) or the Consumer().
@pradeep422
@pradeep422 5 лет назад
Oh My fav Matt heree finally.........:)))) Awesome!!!!!!
@willzarem
@willzarem 4 года назад
Could you guys do an example of how to implement FirebaseCloudMessaging with state management and provider? I'm struggling a bit with it since I want to use the same architecture you're showing. :)
@jayvasant114
@jayvasant114 5 лет назад
Where can I find source code to refer after watching the video ?
@d-apps2699
@d-apps2699 5 лет назад
Thank you for this video but the current version of provider is 3.0.0 but the video is 2.0.1 :(
@LE8271
@LE8271 4 года назад
Is there ANY advantage of Bloc vs Provider in reality?
@mattl7599
@mattl7599 5 лет назад
Matt, where did you get that T-Shirt! Its awesome haha! I want one.
@Michael-ri8sg
@Michael-ri8sg 4 года назад
me2!
@michelfeinstein
@michelfeinstein 5 лет назад
You guys should review the captions, someone captioned "Flutter" as "Photo"
@nidalbakir4720
@nidalbakir4720 4 года назад
provider now is in version (4.x.x) and hopefully, you make video for this and in a way more forcesing on provider itself ''Sorry for bad English "
@lasindunuwanga5292
@lasindunuwanga5292 3 года назад
Awesome vid. They sitting there for almost an hour. Hard working i guess
@RenittoJose
@RenittoJose 4 года назад
stackoverflow.com/questions/57559489/flutter-provider-in-initstate Same issue but I need to pass 2 parameters from the widget to the method in Provider. Couldn't find a proper answer yet. Any help is appreciated.
@Dhruvam
@Dhruvam 5 лет назад
I am definitely going to try Provider. Bloc has been really hard to implement small features.
@djminikin
@djminikin 5 лет назад
actually, that's quite easy even boring and repetitive when you understand how it works.
@EibeMandel
@EibeMandel 5 лет назад
Could you do In-App Purchases next? It's one of the most important topics.
@soufiane_akki
@soufiane_akki 5 лет назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-NWbkKH-2xcQ.html
@shavar67
@shavar67 5 лет назад
EibeMandel they already did checkout the playlist
@zhorky
@zhorky 5 лет назад
Actually receipt validation is way more important, because if you don't validate your IAPs people will cheat on it.
@mohammadhossieni2636
@mohammadhossieni2636 5 лет назад
visit episode 20 and fireship channel too
@Trancecend
@Trancecend 5 лет назад
How old is this? Provider 3.0 has been out for a while now.
@DanielPorto0
@DanielPorto0 5 лет назад
I started thinking that it was an extended version of the IO talk, but instead of a nice way into Provider it was actually a painful guide of something you advised not to do in the talk: which is porting to Provider an app that was already working perfectly in Bloc. As a result it requires knowledge of both (BLoC and Provider) and was a pain to watch. Don't get me wrong, I love the show and I follow the whole series. But the question that remains in my mind after this process is whether I really learned something or got even more confused... was it worth it? Maybe a better move would be porting from hardcore bloc to flutter_bloc lib instead. And for provider lib, something from scratch would more helpful to 'think provider' from the beginning. Of course, that is either a branch of this show or we will have to wait until a new series start. But thanks anyways. Sincerely.
@m.arslankhan7449
@m.arslankhan7449 4 года назад
can anybody explain please @25:02 when the context is replacing with the underscore . why ?
@hadifromlebanon3812
@hadifromlebanon3812 4 года назад
M.Arslan Khan nothing important, usually unused parameters like in this case get named as _ as a convention
@truongsinhtran-nguyen7129
@truongsinhtran-nguyen7129 5 лет назад
As Matt admitted, this is quite struggling and confusing, possibly because we are refactoring from stream pattern to listener pattern. However, after watching this show, I have an impression that Provider is doing more than one things at the same time (SOLID anyone?), one is dependency injection, and two is dataflow/state management. Doing DI, Provider is better and/or easier than InheritedWidget, at least with proper `dispose`. This is the reason it is said that Provider can be used with BLoC, and creates some confusion. Doing state management, it takes a different approach than BLoC (which is basically stream/reactive/Rx), so the learning curve to flutter can be gentler for those who don't have the background in reactive functional
@sweetogo
@sweetogo 4 года назад
So, for state management, is it a Flutter best/preferred practice to use, especially in a new app, provider instead of BLoC? I see even Flutter documentation documents provider for simple state management: flutter.dev/docs/development/data-and-backend/state-mgmt/simple
4 года назад
why you don't advise on checking other patterns like MVP or clean architecture? is it at antipattern somehow to Flutter react world? I'm having some issues with coworkers were they argue that this is now how Flutter should work because you advise Bloc or Provider instead of other's
@KsAmJ
@KsAmJ 5 лет назад
I need this dart shirt 😕
@basudevnayak8762
@basudevnayak8762 3 года назад
Seeing Google guys using apple is fun 😂
@pskpsk6
@pskpsk6 5 лет назад
How are errors handled. Like a Network request failed
@saiprasadchindam5185
@saiprasadchindam5185 2 года назад
Great video, please share the code
@ITMANZ
@ITMANZ 5 лет назад
Hi max :)
@jimjaylee7553
@jimjaylee7553 5 лет назад
That's shortest boring show ever~ Let's bore people further. hahahaha
@shababkarim5907
@shababkarim5907 3 года назад
why is it that every time I start a new app, I need to watch this video :(
@MinhTran-xn3kk
@MinhTran-xn3kk 5 лет назад
Why provider's version is 2.0.1 now ?
@MauricioFernandez78
@MauricioFernandez78 5 лет назад
nop 3.0.1
@websky4241
@websky4241 5 лет назад
It need to be 3.0.0 now 🤔
@andreya1087
@andreya1087 5 лет назад
link to the pull request github.com/filiph/hn_app/pull/7
@thiagoblin
@thiagoblin 5 лет назад
I need that shirt! Where can I find it?
@Michael-ri8sg
@Michael-ri8sg 4 года назад
me2
@raul286162
@raul286162 5 лет назад
Well first at all, please use a black theme for your IDE 😅. Now It was a great refactoring example from Bloc to Provider but, since I'm new in flutter and I'm already starting with couple hours with Bloc, there are some things confusing me, can I really completely replace a complex bloc project with Provider. I was wondering how I’ll deal with certain logic like showing modals, snackbar, notifications, etc. Because all the examples that I found are straightforward. Or is provider not intended to solve such things? It’s just a DI system? PD: 1:01:55 Each one of us has been there 😂
@easyflamer
@easyflamer 5 лет назад
I'm actually curious about the same stuff. I kinda have some stuff like triggering snackbars with Provider but I feel like it's very hacky and it'd help a lot to see what idiomatic Dart looks like for that XD
@guidoc3518
@guidoc3518 4 года назад
it only works on debug mode, on release it doesn't work unless you kill the app and reopen.
@prafulgupta7004
@prafulgupta7004 5 лет назад
Have a look at state_rebuilder
@TusharOjha
@TusharOjha 4 года назад
53:59
@zhenliu287
@zhenliu287 5 лет назад
Why no Chinese subtitles?
@GroovinChip
@GroovinChip 5 лет назад
Matt's Flutter apparel making me jealous as usual lol
@jasonleo
@jasonleo 4 года назад
what exactly is BLoC stand for
@wongni
@wongni 4 года назад
Business Logic Component
@jasonleo
@jasonleo 4 года назад
@@wongni thank you!
@SafdarAliShah_TimeTraveler
@SafdarAliShah_TimeTraveler 5 лет назад
Amazing...Videos..Love it from Pakistan..Peace out..TC #flutter #love_flutter #pakistan #dart #provider
@MyDisal
@MyDisal 4 года назад
can you please go dark mode?
@MinhTran-xn3kk
@MinhTran-xn3kk 5 лет назад
39:10 why ids is final . i usually use var :(
@suzukiaki6066
@suzukiaki6066 5 лет назад
Because there're no reassignment of that variable. Using final makes code easier to understand and it tells the next reader that the value is from only this assignment not from elsewhere. Basically if you keep functions small, variables is not gonna be assigned multiple times.
@xiaojiangguo1596
@xiaojiangguo1596 5 лет назад
mark
@sahilkumar2953
@sahilkumar2953 5 лет назад
This looks more or less like scopedModel to me
@G4MR1
@G4MR1 5 лет назад
I clicked that link so fast!
@michelfeinstein
@michelfeinstein 5 лет назад
Guys, I love the show, but I honestly think it could be a lot better if you had some preparations beforehand. This way you could show us all the struggles that you had, but just taking a small amount of time, while coding the best solution at the show.... Instead of just trying to make things work in one hour, and not showing us the proper way to solve things. I don't mean to be harsh, I just think the show could be better, more informative this way :)
@arqamhussain8298
@arqamhussain8298 3 года назад
Wait a minute ! they are using macbooks !
@gofudgeyourselves9024
@gofudgeyourselves9024 5 лет назад
Last
@mukhtarfauzi5824
@mukhtarfauzi5824 5 лет назад
koplak 😁
@kamaleshbasu3755
@kamaleshbasu3755 4 года назад
While Provider is good for smaller apps, I constantly find that it gets cumbersome when working with multiple developers and for really large Apps. Redux is definitely the way to go for such Apps.
@tuobraun
@tuobraun 5 лет назад
Oh, I wish I could understand something :’( I guess I need to start from scratch again...
@bacharsaleh6984
@bacharsaleh6984 5 лет назад
Old record. Provider version now is 3. 😁
@raul286162
@raul286162 5 лет назад
That was quick xD
@ramonblack
@ramonblack 2 года назад
tutorial on how to program without google haha
@praharshbhatt2934
@praharshbhatt2934 5 лет назад
first
@themri
@themri 5 лет назад
The most confused boring show
@filiphracek
@filiphracek 5 лет назад
That's my secret Cap. I'm always confused.
@davidurbina6555
@davidurbina6555 5 лет назад
@@filiphracek This is good. Makes devs know it's ok to be confused sometimes. Thanks for this one!
@rikyriky966
@rikyriky966 5 лет назад
Sorry but this video provides nothing beneficial to me. Why don’t you guys go with somewhat the basics?
@poindexterfrink8276
@poindexterfrink8276 5 лет назад
To those looking to quickly learn and implement clean state management in flutter, skip learning this whole layer and check out flutter_redux.
@RaphaelPungin
@RaphaelPungin 3 года назад
Too much talking about unrelated stuff. Please stick to the topic and this will make the video shorter. We need to spend time coding our own apps rather than watching one-hour videos. Thanks!
Далее
Change Notifier Provider Explained
14:32
Просмотров 20 тыс.
Survive 100 Days In Nuclear Bunker, Win $500,000
32:21
ELA NÃO ESPERAVA POR ISSO 🥶 ATTITUDE #shorts
00:20
Flutter State Management - The Grand Tour
14:07
Просмотров 239 тыс.
Pragmatic State Management in Flutter (Google I/O'19)
33:25
Flutter Provider State Management in 7 minutes
7:01
Просмотров 14 тыс.
Flutter Provider EASY Tutorial
9:43
Просмотров 46 тыс.
Flutter Provider Simply Explained
9:08
Просмотров 88 тыс.