After two years, this very important video starts getting old. With libraries being updated may be it is time for Fireship to revisit this topic. Thanks for your hardwork. A very nice channel indeed.
@jackrdye
Жыл бұрын
Yes update vid please :)
@arvidd
Жыл бұрын
Sounds good to me 🙂
@umairahmed522
Жыл бұрын
@kairos_moments
10 ай бұрын
yess, update please
@FelipeCampelo0
8 ай бұрын
Up
@rubensdemelo
5 жыл бұрын
Best video about state management with flutter. Congratulations !!🎊
@alithejumbo
5 жыл бұрын
Dude your way of teaching is the BEST I have ever seen. Fast, clean, simple and straight to the point. Why don't you make Udemy courses? If you do please tell me about them.
@mmsergi
5 жыл бұрын
What about Provider approach? Is the one that Im using, what's your opinion about it?
@MrHimanshun
3 жыл бұрын
@Ruwen Höltge I am very new other SM , could please tell me what is a service locator??
@TimothyNazar
3 жыл бұрын
@@MrHimanshun The service locator pattern is a design pattern used in software development to encapsulate the processes involved in obtaining a service with a strong abstraction layer. This pattern uses a central registry [that's what you typically see in main.dart file in a form of MultiProvider([service1, service2])] known as the "service locator", which on request returns the information necessary to perform a certain task. en.wikipedia.org/wiki/Service_locator_pattern
@bobthebuilder6715
3 жыл бұрын
@Ruwen Höltge I wish I read your comment 1 year ago
@SeriesTube01
3 жыл бұрын
I use Provider too. 👍
@SeriesTube01
3 жыл бұрын
@Ruwen Höltge We know what it is. He is asking why wasn't even mentioned in the video since it is, by far, the most used library for state managemente in Flutter. I'm surprised about that too.
Should've mentioned Provider. it's simple and solid, and much like the scoped_model library but much more popular
@friebetill
4 жыл бұрын
@@sadhlife Yes, I agree, although at the time the video was released, Provider was introduced by the Flutter Team at the Google IO 2019. kzitem.info/news/bejne/xZWjm5eppqSXan4 Therefore one cannot blame Fireship for not presenting providers then. However, by now Provider should be mentioned via an overlay, because Provider is the standard way to manage the state in Flutter.
@sadhlife
4 жыл бұрын
@@friebetill i see, didn't know, and yeah!
@mehraanakbarii
3 жыл бұрын
Should we know all of them?
@friebetill
3 жыл бұрын
@@mehraanakbarii Definitely not, start with a simple one e.g. provider and then you can still upgrade to more powerful systems if necessary.
@FredvanRijswijk
5 жыл бұрын
Now I feel stupid ;-)
@Fireship
5 жыл бұрын
This video took a lot of effort and testing, state management is hard.
@kirill4531
5 жыл бұрын
I'm glad I'm not the only one here))
@osamabadr9458
4 жыл бұрын
Same feeling here 😭
@UlyssesAlexandreAlves
4 жыл бұрын
I'm totally with you there, bro.
@SeriesTube01
3 жыл бұрын
I remember like a year ago I bought this web development course and the Redux and Hooks sections were explained for like a 5 year old. Still I didn't understand jack shit. 🤦♂
@sadabwasim9850
5 жыл бұрын
Fireship is becoming one of the best tech channel, It's content are simply amazing.
@Fireship
5 жыл бұрын
Thank you Sadab!
@johanemerson307
3 жыл бұрын
sorry to be so off topic but does any of you know a method to log back into an Instagram account?? I somehow lost the login password. I appreciate any assistance you can give me
@londonsonny6112
3 жыл бұрын
@Johan Emerson instablaster ;)
@johanemerson307
3 жыл бұрын
@London Sonny I really appreciate your reply. I found the site on google and I'm in the hacking process atm. Takes a while so I will reply here later when my account password hopefully is recovered.
@johanemerson307
3 жыл бұрын
@London Sonny It did the trick and I finally got access to my account again. I am so happy:D Thank you so much, you saved my ass!
@RobertBrunhage
5 жыл бұрын
Wasn't aware of the get_it package, will definitely check it out. Great video! Wished I had this video when I started haha
@happynewyearw
5 жыл бұрын
Check out this blog about get_it + rxdart/rxcommand: www.burkharts.net/apps/blog/rxvms-foundations-rxcommand-and-getit/ Looking forward for more awesome videos of practicle demonstration base on these tools from you too! Great job, Thanks!
@faaf42
4 жыл бұрын
In case you wonder syntax "stream$" at 7:13 it's medium.com/@benlesh/observables-and-finnish-notation-df8356ed1c9b (observable - convention for naming it)
@VictorKun
5 жыл бұрын
I'm amazed by the fact that you know so much, I keep wondering about the effort it took for you to reach there. :) Great video and work. Cliche...
@emmanuelogbewe2334
5 жыл бұрын
Man I’ve been waiting for this. Has to be one of the best vids on state management. Thank you!!
@NatiTessema
5 жыл бұрын
Glad I found this video before starting. You da man
@tesla1772
4 жыл бұрын
shit i was passing values to each and every constructor ... : )
@boismd
4 жыл бұрын
aw shit we are in the same boat
@danielsolomon6227
4 ай бұрын
I think it's time to revisit this topic because I waiting to learn about Provider and Riverpod.
@kamranbashir4842
4 жыл бұрын
01:57 I can't stop myself to press ctrl+s to remove that round ball with main.dat indicating that file is not saved.
@merthyr1831
2 жыл бұрын
Great video, but a 2022 version would be awesome! Almost everything after the starter app/stateful widget are mostly unused now :)
@darshangowda309
5 жыл бұрын
Thanks for making a list of every solution at one place! BehaviourSubject & RxDart looks super neat and pretty much solves every problem :P
@Fireship
5 жыл бұрын
BehaviorSubjects are amazing :)
@hasanimam82
4 жыл бұрын
Great video, almost covered everything about state management, Thanks! My thoughts: - I've never heard about StateBuilder and that it can be used with StatelessWidget, which can really be helpful sometimes. - i didn't know that we should use SetState function inside the Inherited Widget, is that necessary? - you probably didn't mention the Provider and ChangeNotifier classes because they came after this video, but they're quite an extension for ScopeModel class. - My favourite approaches for state management are: Provider, Bloc and get_it, or maybe a mix between two of them.
@benjieming7232
3 жыл бұрын
The provider is maybe the best solution for state management for me.
@nikhi1
5 жыл бұрын
Behave responsibly with the state!! Awesome intro to all the patterns for flutter. 😀😀
@AndreaGiacon
5 жыл бұрын
Finally: a clear explanation of states management. Thank you
@DanielTubul
3 жыл бұрын
such a long video but passed so fast = A really good one!!! thanks for that
@dhiyaaulauliyaa3988
5 жыл бұрын
Good video! This video uploaded at just right time for me when struggling to understand flutter. Flutter hook looks promising for me btw. Love the flutter t-shirt 😄
@MarkVolkmann
2 жыл бұрын
For simplicity, consider using provider which has been recomended by the Flutter team for a while now.
@abhishekdewadiga1113
5 жыл бұрын
Nicely done!!! All the possible state management approaches for a flutter app. 👍
@MCorpJC
4 жыл бұрын
Provider is missing in the list 🙂 good video
@BiniamAsnake
4 жыл бұрын
Thanks for the best summary with code samples. The flutter doc now gives an example using Provider package. Do you recommend using that instead of BLOC or RxDart? flutter.dev/docs/development/data-and-backend/state-mgmt/simple
@idemchenko-js
3 жыл бұрын
The Elm Architecture is the godfather of redux and bloc and similar. I personally can distinguish two overarching ideas for state management: state-action-view or FRP. Web devs went through this, now it's flutter's time. However, Elm also used to use FRP but moved on as it didn't scale.
@akshattamrakar9071
2 жыл бұрын
I liked elm but no company I worked at and no developer I know is using elm.
@idemchenko-js
2 жыл бұрын
@@akshattamrakar9071 regardless of that, the elm architecture has made a massive impact on the industry.
@Carlos_Carrascosa
3 жыл бұрын
I just came across this video, it explains the fundamentals really good. I've ended up using riverpod after doing my research, but it is not mentioned in this video, maybe you could do a new one!! Great channel
@agoodmansaid
4 жыл бұрын
Don't get me wrong Fireship is one the best channels for flutter, but i'm yet to find a tutorial that gets deep into detail about how and why something works. most state-management tutorials here assume an intermediate level of flutter
@blank-vw2sb
5 жыл бұрын
Fireship is sailing in flutter! it's Awesome
@StevenTse
5 жыл бұрын
thx for the vid, how about Provider?
@sadhlife
4 жыл бұрын
scoped_model looked exactly like it, but I think provider is made by the flutter team itself
@maexlep89
4 жыл бұрын
I agree that the model part looks very similar and I still have some questionmarks about pros and cons of both. A great and simple Provider-showcasing/template can be found in the video 'Flutter Provider Architecture for State Management' from filledStacks. Would be great if fireship could talk >a bit more< about when he would personally use either of these solutions.
@sadhlife
4 жыл бұрын
@@maexlep89 Provider is now the preferred method, snd was suggested by google devs in IO 19, a few weeks after this video went live flutter_bloc is also gaining popularity stuff like rxjs is too complicated to justify usage in many apps when provider can do it just fine, and get_it is better for much simpler apps.
@deriegle
5 жыл бұрын
Thanks a lot for the video. I loved the explanation. I think I want to try out the Bloc pattern. I use redux in my current react native project, but honestly I try to avoid putting anything in redux if possible, because of the boilerplate. I definitely like the look of Bloc pattern in Flutter and the T-shirt! Hope I win it. Thanks for the awesome video.
@lunargixx6867
5 жыл бұрын
Fantastic video about state management
@kishansampat4632
4 жыл бұрын
Why to use state management when we have providers and change notifier we can use them too as a substitute. flutter works awesome with this its rapid development when you use these according to my experience
@andrewgoeden103
5 жыл бұрын
I am a personal fan of Firebase because of its adaptability and the ease of integrations. It is definitely a little buggy since I last used Firestore in Flutter (February 2019) but a great POC item.
@emericgnonhoue7029
5 жыл бұрын
Great content. I think I'll go with BLoC
@Fireship
5 жыл бұрын
Not a bad choice :)
@divinedela9125
5 жыл бұрын
Great as always.
@oztech
5 жыл бұрын
Fantastic. But wait... so what is the best way? I used redux with flutter. Should i go with BLOC instead?
@Fireship
5 жыл бұрын
There is no best way! Do feels right in your heart ❤️
@oztech
5 жыл бұрын
@@Fireship anyways thanks for the great video. Ive learned a lot since your ng related videos. Im also from ionic background completely switched to Flutter and so happy with it.
@amsakanna
5 жыл бұрын
Redux is great IMO. Take a look at redux epics too.
@oztech
5 жыл бұрын
@@amsakanna i use Redux for many projects. Yeah its great but it requires too much coding.
@oztech
5 жыл бұрын
@@Fireship i tried BloC pattern and now loving it!
@xtraszone
2 жыл бұрын
// ! RxDart Cheatsheet // Step 1: Create global variable BehaviorSubject counter = BehaviorSubject.seeded(0); // Step 2: Access variable inside StreamBuilder StreamBuilder( stream: counter.stream, builder: (context, snapshot) { return Text('Count: ${snapshot.data}'); }, ) // Step 3: Modify the variable counter.add(counter.value + 1); // Step 4 (Optional): Close the stream when not required @override void dispose() { counter.close() }
@akshattamrakar9071
2 жыл бұрын
Yes, that's pretty much correct... Easy and straight forward..
@vinayrwt
2 жыл бұрын
Now we have Get library which is really amazing 😃
@troykoss
5 жыл бұрын
State management is super overcomplicated. I still can't find a use case with a need.
@Fireship
5 жыл бұрын
KISS is the best state management solution
@bascelik91
4 жыл бұрын
I really like Bloc state management, compared to Redux, you can create as much bloc objects as you want and you can get fine grain control in the app. Also, Mobx is pretty funny state management library, it reduce boilerplate code in the app and it is easy to maintain the code. These two libs I used in several projects and they are pretty reliable and easy to use.
@mikoaj1954
2 жыл бұрын
this video is a little bit outdated. In my opinion the best option for beginners is provider, which might be replaced with bloc in big projects.
@happynewyearw
5 жыл бұрын
Thx for the great videos as always! Hope to get more videos on RxDart + RxCommand + GetIt + Firebase (simple tut or some example app using these packages will be awesome!), this set of packages is the best state management techniques in Flutter based on what I've read and understand, if I'm wrong please tell me, I'm pretty new to all of these, so I would like to learn more! btw, really thanks to Frank Pepermans, Brian Egan and Thomas Burkhart , these Flutter/Dart packages really makes me exited and joyful to build app in Flutter!
@Fireship
5 жыл бұрын
Very thankful for their contributions! Have not used RxCommand yet, but looks interesting :)
@happynewyearw
5 жыл бұрын
@@Fireship Cool! definitely take a look if you can, check out the author's article here: www.burkharts.net/apps/blog/rxvms-foundations-rxcommand-and-getit/ I've been looking for more videos or article about RxDart + GetIt + Firebase, but no luck for now, look forward to see more people start to use and showcase these combination of packages!
@francescofreddi4374
4 жыл бұрын
Provider? is not mention
@AbhishekKumar-mq1tt
5 жыл бұрын
Thank u for this awesome video
@Fullstackdesign
5 жыл бұрын
Good job on the video, I know how much time and effort it takes to make these videos. As for state management for a prototype, would you recommend using BLOC?
@Fireship
5 жыл бұрын
Thank you, this video was extra challenging. Bloc might be more than you need for a prototype, scoped model or a simple stream might be easier.
@DevKhalilKhalil
5 жыл бұрын
Thank you very much for this nice created video, it was really helpful.
@nagas_dev
5 жыл бұрын
One of the best videos, demonstrating most of the ways for state management. You got my attention with firestore as a state management option and I really want to watch a video about it, explaining how can be used.
@pardipbhatti9943
5 жыл бұрын
Thanks for the video. I just got pro membership at your site.
@JonWood
5 жыл бұрын
Never knew there were so many ways to handle state management. Thanks for explaining each of these techniques!
@MultiTelefono
3 жыл бұрын
thanks for the video!!
@misterkevin_rs4401
5 жыл бұрын
I personally dislike adding more libraries to the project, but i think RXDart + GetIT is the way to go. Specially when there are solutions out there for really common scenarios which are needed on a realistic app The hydrated package takes your state and persist it to app storage and loads it after you close it, which is specially useful. pub.dartlang.org/packages/hydrated
@happynewyearw
5 жыл бұрын
Didn't know hydrate package before, looks very useful! You can take a look at rxcommand as well, I'm curious how well rxcommand works with hydrate.
@AvinashSingh-nq5ud
5 жыл бұрын
Which state management you prefer for a beginner or intermediate flutter developers??
@Fireship
5 жыл бұрын
Scoped Model or the BehaviorSubject approach I showed in the video.
@AvinashSingh-nq5ud
5 жыл бұрын
Thanks
@brylie
Ай бұрын
Please update this video since Provider is now a recommendation from the Flutter docs.
@juliancorredor1128
5 жыл бұрын
I think state management makes easier the development of reactive uis, it helps a lot with dealing things like setState or manually re rendering the hole or widget when you may only need to render a specific small portion of it. On the other hand, helps sharing information across a wide component or widget tree which is a huge advantage
@Fireship
5 жыл бұрын
Sharing data easily has always been a big one for me, makes prototyping way faster imo.
@wearecode9199
4 жыл бұрын
I came to learn InheritedWidget i left with Rx...
@Fanaro
4 жыл бұрын
Thank you for stating that the web benchmarked way of handling state, i.e. rx with basic streams, is your favorite way. It gives me confidence that I can handle Flutter state management with what other fields already use and don't have to reinvent the wheel over again. And stating that Firebase is already a huge solution for 99% of state management is also very important, and something most purists frown upon.
@mohammadahsan6781
4 жыл бұрын
I will prefer bloc. Because bloc seems more simpler to me. Now will I get my flutter T shirt?
@lokeshar6649
5 жыл бұрын
Simply superb... Almost you covered everything.
@raghav.bhardwaj
4 жыл бұрын
Thank you for his Video. What is your opinion on Flutter provider package?
@RahulJoshi-di3mm
4 жыл бұрын
Provider???????????
@RageBasterd
5 жыл бұрын
Bloc all the way
@lutfi_gr
3 жыл бұрын
I start using Bloc but seems a little bit different from your example which version of Bloc are you using, mine btw is flutter_bloc package version 6.1.1 at the moment that this comment was posted 😎👍
@jaideepprasad567
5 жыл бұрын
@Fireship I think scopedModel is a bit difficult to understand in relation to state management. More practice and clarity is needed for developers.
@shubhamjaiswal3029
5 жыл бұрын
Amazing Video Man!! ;)
@tommyeagen3763
4 жыл бұрын
I am a beginner to Dart and Flutter and this confuses us me on so many levels, I am wondering what kind of app needs a widget tree that deep to cause Flutter community to provide that many tools for state management?
@siddhantkumar7036
5 жыл бұрын
Ha! State management ..... Hard to learn but this video helped!
@Fireship
5 жыл бұрын
Sometimes it's only hard if you make it hard, focus on keeping it simple :)
@RogerOnTheRight
5 жыл бұрын
Sure talks fast.
@jaideepprasad567
5 жыл бұрын
Well Kudos to @fireship.io for this video. Does clears a lot of my doubts. But one suggestion : Go a bit slow as it is difficult to understand for newcomers. And may be give some practicality by building an app with the concept from scratch. But overall great video. :)
@jeromestsauver
5 жыл бұрын
Yes! Thanks for this
@TheRedDaren
5 жыл бұрын
Just when I got into Flutter. Perfect timing.
@lvl4ul2i
5 жыл бұрын
I love your channel you are very concise and you talk about what really matters
@pranjalgoyal6747
4 жыл бұрын
Hey what about Provider I think google recommends to use Provider ??
@narcodico
5 жыл бұрын
BLoC/flutter_bloc is the way to go for local state and Redux/RxDart way, for global state. The rest is just for basic state management when you don't expect your app to grow. I didn't know about the flutter hooks package, but looks really interesting.
@Fireship
5 жыл бұрын
I would agree with you here, it's nice to to have the flexibility of both.
@Dorumin
5 жыл бұрын
I've personally found redux awkward to implement, and stream-based solutions wasteful (I know that dart is optimized to build lots of immutable objects and dispose of them quickly with its GC, but I've never trusted it too much :P) I like the simplicity of scoped_model because you don't have to implement whether the widget should update when you consume it, and you can still have a singleton with other models so you can do stuff like serialization and persisting the data. I'm not saying that it's the solution for everyone though, persistent storage is just a weird requirement I have
@Fireship
5 жыл бұрын
@@Dorumin Scoped model is really awesome, that's probably why its in the official docs now. Personally, I like my streams because they can controlled and monitored in predictable ways, and just feel right with realtime data sources like firebase.
@narcodico
5 жыл бұрын
@@Fireship Yes, often enough, it's recommended to use a combination of available state management solutions based on your needs. There will never be one fits all case.
@narcodico
5 жыл бұрын
@@Dorumin Stream-based libraries and reactive programming are the best thing that ever happened in software development. You are severely underrating the true power of Rx and co. Completely changed the game for how apps are architectured and built.
@TurtleWargaming
5 жыл бұрын
What state management strategy would you recommend for the scenario described at 4:12? I'm currently stuck on a project trying to figure out a good solution. The siblings are a list of users, and when tapping one of the users in that widget, it should somehow give that user object to its sibling "form" widget, to prepopulate and edit.
@frankhuang4056
Жыл бұрын
Please keep the music down. It's quite distracting.
@politicallynotcorrect2968
4 жыл бұрын
I think something like vuex is very simple to understand and still very powerful
@ardeshirojan1468
4 жыл бұрын
I am not a noob in flutter and coding but after the first two minutes, I didn't understand anything... i don't know he explained bad or I am just stupid or something...
@rshirkhanov
4 жыл бұрын
How can I pass some arguments, using Flutter Hooks' useReducer?
@st0len729
3 жыл бұрын
Why is the Stream in the RxDart section called stream$? Is it a convention? If yes, what does the dollar sign mean and when should I add it?
@palkollar7739
3 жыл бұрын
"Solid state management solution" I thought of SSD right away 😅
@rnvdrs
5 жыл бұрын
I see BloC makes a lot of sense for flutter
@corynorell3686
5 жыл бұрын
Does anyone have a one-line (or close to) definition of 'state'? I hear the term used a lot, but its exact definition is a bit illusive.
@Fireship
5 жыл бұрын
Data that determines the shape of the UI.
@corynorell3686
5 жыл бұрын
@@Fireship Well that is much simpler than I anticipated. Thank you so much!
@Mar_Ten
2 жыл бұрын
The fact that providers are not even mentioned here scares me a bit. This video definitely needs an update.
@elliotheath5366
5 жыл бұрын
If a framework isn't opinionated, the developers surely will be. Humble flutter request: travisci / fastlane
@Fireship
5 жыл бұрын
Well said! I think a solid CI/CD video for flutter will come soon :)
@MichaelRichins
5 жыл бұрын
I for one am a huge fan of Behavior Subjects. Both in Angular and now in my new love of Flutter.
@Fireship
5 жыл бұрын
BehaviorSubjects FTW!
@sven2529
Жыл бұрын
InheritedCounter Part not working: Failed assertion: line 41 pos 12: 'result != null': No InheritedCounter found in context)
@CaiCruz
5 жыл бұрын
State management is a fairly new subject for me, but from first impressions of using redux in angular, I'd say is very complicated to try to mitigate issues that could be solve in different and simpler ways. Thanks for the video. Your channel has some great info! :)
@Nobody-ky7sl
5 жыл бұрын
Bloc is awesomee
@stevenzhang7582
5 жыл бұрын
I'm confused by state by I think I'm getting the hang of things!! Thanks for the tutorial and love that flutter t shirt!
@sushantnp
4 жыл бұрын
I am new to flutter and have experience with React and Redux. So, what should I use for state management tool for my projects. I know redux pretty enough.
@calvinvoo2
5 жыл бұрын
So inherited is similar with react context provider and consumer?
@Fireship
5 жыл бұрын
Yes, similar concept.
@balabuyew
5 жыл бұрын
Why you think, that instantiating state inside Widget is correct? You do this in StatefulBuilder example (mutable counter field), then in InheritedWidget example (mutable map in Widget field), then in BLoC example (bloc: CounterBloc()). This is incorrect! Because, at some moment new Widget can replace old one and your int/map/CounterBloc will be effectively reinitialized to default value.
@clavio9561
4 жыл бұрын
I don't see Provider in the list, any reason? it is the hottest topic now.
@cedvdb6473
4 жыл бұрын
whats the problem of declaring a list of the services instances in the global scope ? Or even make them singleton if that's the potential issue?
@themindstorm9947
5 жыл бұрын
Do you think Flutter is better than Ionic 4?
@Fireship
5 жыл бұрын
No, depends on the use case, so it's more about choosing the right tool for the job. Flutter has a lot of advantages when it comes to build high-quality iOS/Android apps, but cannot easily share code on the web - that's where Ionic really shines.
@oztech
5 жыл бұрын
Once hummingbird is supported, then flutter would be a preferable choice. But who knows? Some might not want to learn new language, Dart.
@jamesr2408
2 жыл бұрын
@7:12, What is stream$ ? Just another function name? Why use the $ sign?
@akshattamrakar9071
2 жыл бұрын
It's a industrial standard practice to use $ after nave of stream. Nothing special, it tells developers that this is reactive in nature. I never put $ because it looks wierd bu it's up to you.
@Quintusvw
5 жыл бұрын
A very useful overview of state management for developers on a time-constraint budget. Thanks for the introduction!
@uttampanchasara6465
5 жыл бұрын
Really helpful as state management is very important thing in flutter 👍 I personally prefer rxDart to manage states with stream building, and recently I was working with rxDart and when I was trying to do something in onCancel() of observable but not working and when didn't find the solution by myself I asked the question on stack overflow but didn't get any answer yet. It would be nice if you can answer that I'm doing the right thing or not and why? Question: stackoverflow.com/questions/58376889/dooncancel-not-triggered-on-calling-streamcontrollerclose
Пікірлер: 347