Understanding State Management in Flutter - Foundation

  Рет қаралды 24,768

Flutter Explained

Flutter Explained

Күн бұрын

Let us talk about State Management Foundation. We will speak about State Management in general and will then have a look into the different Technologies.
The presentation can be found on Patreon and it would be fantastic if you support us and thanks for everything.
/ flutterexp
⭐️⭐Table of Content ⭐️⭐️
0:00 Introduction
0:20 Why State Management
1:20 Definition of State
Definition Techopedia - www.techopedia.com/definition...
Twitter Feed - / 1265894296714182657
2:30 - Reasons to have proper state management
3:35 - Tradeoffs of proper state management
5:38 - State Management in different Technologies
React - Redux: redux.js.org/
Angular - Ngrx: ngrx.io/
Vue - VueX: vuex.vuejs.org/
7:21 - State Management in Flutter
docs.flutter.dev/development/...
7:55 - SetState pattern
8:44 - The Provider Package
Pub Package - pub.dev/packages/provider
9:25 - BLoC - Business Logic Component
BLoC package - pub.dev/packages/bloc
Flutter BLoC package - pub.dev/packages/flutter_bloc
10:00 - Redux
Redux package - pub.dev/packages/redux
Flutter Redux package - pub.dev/packages/flutter_redux
10:40 - States Rebuilder
State Rebuilder Package - pub.dev/packages/states_rebui...
11:25 - MobX
MobX package - pub.dev/packages/mobx
Flutter MobX package - pub.dev/packages/flutter_mobx
12:10 - How to decide
13:15 - Next Steps for State Management on Flutter Explained - Outro
Tools we use to grow our KZbin channel
TubeBuddy Review - Manage Your KZbin Channel Easily
www.tubebuddy.com/flutterexpl...
Our current KZbin gear
🎙 Samson Mic: amzn.to/324Gpof
📟 Satechi USB-C Adapter: amzn.to/3kUdQ5M
💻 MacBook Pro: amzn.to/3iQ9MBx
📹 Lumix FZ1000: amzn.to/3g7tW8D
⭐️⭐️Follow us ⭐️⭐️
Twitter Mahtab - / mahtab_dev
GitHub Mahtab - github.com/mt-tadayon
Twitter Max - / flutter_exp
Github Max - github.com/md-weber
Homepage - myracledesign.de/blog
⭐️⭐️ Support ⭐️⭐️
If you read this so far, thank you once more. If you like to support us, here are some links that could help us a lot.
Donation via Streamlabs - You are free to donate us a small amount, so we can keep up our work.
flutterexplained.live/
Amazon Affiliate Link - You buy for the same price, and we get a small amount of it. This leads to an amazing Flutter book that we can recommend to every beginner of flutter amzn.to/2uOJXON

Пікірлер: 54
@goddardpk
@goddardpk 3 жыл бұрын
Max, thanks for the high level introduction to state management and the clean use of diagrams to support your descriptions!
@FlutterExplained
@FlutterExplained 3 жыл бұрын
You are most welcome Paul, thank you for your amazing feedback :)
@aravindc6946
@aravindc6946 4 жыл бұрын
Thanks for the video. Now I have a clear idea to start with State management
@anyiethaguekayuen5688
@anyiethaguekayuen5688 3 жыл бұрын
Thanks for your explanation, it is clear enough.
@jrheisler
@jrheisler 4 жыл бұрын
Very good video, thank you!
@FlutterExplained
@FlutterExplained 4 жыл бұрын
You are very welcome, I am glad that you enjoyed it!
@faihan988
@faihan988 3 жыл бұрын
That's a top quality video. You definitely deserve a lot more views and subscribers.
@FlutterExplained
@FlutterExplained 3 жыл бұрын
Thank you, I am glad that you think so :)
@PaulMsegeya
@PaulMsegeya 3 жыл бұрын
Awesome content, keep up the good work.
@FlutterExplained
@FlutterExplained 3 жыл бұрын
Thank you, I give my best :)
@Darthilandia
@Darthilandia 3 жыл бұрын
Nice video mate!
@FlutterExplained
@FlutterExplained 3 жыл бұрын
Thank you, I am glad that it helped you :)
@meylisannagurbanow3455
@meylisannagurbanow3455 3 жыл бұрын
I like your videos buddy. You crushing it!
@FlutterExplained
@FlutterExplained 2 жыл бұрын
Thank you so much!
@iAnguel
@iAnguel 2 жыл бұрын
Thanks for the overview. I wonder if it is possible to recommend a state management package for a specific use case like a Flutter UI with a network client underneath that sends commands to a server and then react depending on the server responses, i.e. changes the UI. From the overview looks like BLOC is a good fit, but maybe I am wrong? What would you recommend?
@Saketjsaket
@Saketjsaket 4 жыл бұрын
I really loved the video. Is it possible to use redux in combination with bloc? and is it a good idea to do it?
@FlutterExplained
@FlutterExplained 4 жыл бұрын
Thanks for your feedback :). Is it possible, I am pretty sure, and there is already a package that does exactly this. There is even a package that tries to achieve exactly that. pub.dev/packages/bloc_redux But I am not sure if it is a good idea, behind each package there are a big fanbase and community, and most likely there is a reason why they decided for one pattern or the other. Another way would be to work with RxDart and create your own "bloc" pattern like, for example, GroovinChip and Luke Pighetti explained in their interviews.
@ivanyoed
@ivanyoed 3 жыл бұрын
I kept waiting for GetX. Besides, this state management package is more used and famous than all the others mentioned, except for Provider. Hopefully you'll talk about it later. Anyways. Thank you for making this video and again, nice Job! Sharing this vid.
@FlutterExplained
@FlutterExplained 3 жыл бұрын
Hi thanks for letting me know, I have getX on my todos, but I am a bit negativly biased and want to try to get more information and maybe talk with some experts before I announce my oppinion to it :). I am happy that you liked the session so far.
@ivanyoed
@ivanyoed 3 жыл бұрын
@@FlutterExplained Thanks! It seems to me that you are proceeding professionally, and I like that. Hoping to watch that video! And again, keep it up!
@dipakbari4
@dipakbari4 3 жыл бұрын
In the context of State Management of Flutter, Can we say like State Class used to return the state object that contains Stateful Widget? [Especially when the createState() method called.]
@FlutterExplained
@FlutterExplained 3 жыл бұрын
Uf, that is a tough one. I gutess you could say that. The only problem is that there is more than just a Stateful Widget that could contain state, also Services that are used inside of your widgets could contain state. But as a general rule of thumb I guess this is pretty accurate!
@atlantis_expedition_member4747
@atlantis_expedition_member4747 4 жыл бұрын
I'm learning state management for the first time at moment. I loved the video as an overview of the current solutions. I can't wait for the provider video. I think it's the best one to start with for beginners. Note: maybe it's my phone speaker, but the audio can be improved. It's slightly not enjoyable to listen to.
@FlutterExplained
@FlutterExplained 4 жыл бұрын
Thanks for the note I will check and look if I can improve it for the next time :)
@dipakbari4
@dipakbari4 3 жыл бұрын
12:10 Best State Management solution is here. :-)
@FlutterExplained
@FlutterExplained 3 жыл бұрын
Wow this video is recorded on the 2. June :O how much has changed since then is absolutly incredible.
@dipakbari4
@dipakbari4 3 жыл бұрын
@@FlutterExplained 😀. Whenever I get doubts I usually look for "MyFlutterDoubts flutter explained" 😂🤣
@mgbhadurudeen336
@mgbhadurudeen336 2 жыл бұрын
it would have been better, if you have shown any code. anyhow good video, thank you.
@FlutterExplained
@FlutterExplained 2 жыл бұрын
There are multiple follow up videos for different state management libs like setState / provider and redux :) feel free to check them out.
@eleazarfederio1718
@eleazarfederio1718 3 жыл бұрын
Does stateless is like functional component in react?
@FlutterExplained
@FlutterExplained 3 жыл бұрын
Correct, dumb and without any state :)
@abhishekbhambure5146
@abhishekbhambure5146 3 жыл бұрын
SUBED
@FlutterExplained
@FlutterExplained 3 жыл бұрын
Welcome to the family :)
@Toasticuss
@Toasticuss 4 жыл бұрын
What are examples of too much boiler plate code with the provider package? It seems to have the least amount.
@FlutterExplained
@FlutterExplained 4 жыл бұрын
Hi Toasticuss, for me, it started the first time I required three different ChangeNotifier at one point and, I needed to wrap three Consumers around each other. That lead to a tremendous sized widget. It could be that it was just wrongly used, but other packages helped me there a lot. I think that Provider is a right choice and will work, but in large-scale projects, I would not rely solely on it. Maybe more boilerplate was wrongly chosen, and it should be more confusing or bloated widget tree.
@mivoligo
@mivoligo 4 жыл бұрын
@@FlutterExplained You can use MultiProvider in order to make the code look cleaner. pub.dev/documentation/provider/latest/provider/MultiProvider-class.html
@FlutterExplained
@FlutterExplained 4 жыл бұрын
But this helps only with the registration not with the consumer right?
@mivoligo
@mivoligo 4 жыл бұрын
@@FlutterExplained I think it depends on the situation. I'm trying to learn Flutter myself at the moment, so unfortunately I don't know if I do this right but I wrap each widget separately with Consumer if it needs to be notified about changes.
@FlutterExplained
@FlutterExplained 4 жыл бұрын
@@mivoligo That sounds right :) the problem is just that if you have a widget that needs multiple consumers, then the widget tree gets bit messy but I will show in my video what I mean :). Thanks for sharing your conserns.
@bobobobo3142
@bobobobo3142 4 жыл бұрын
What about Provider? Is it good enough?
@FlutterExplained
@FlutterExplained 4 жыл бұрын
Yes of course in 8:44 I talked about it. It is great in most cases and in smaller apps. You could only run into long-term issues with boilerplating and other packages have additional features that help but the trade off is higher. I hope that helps.
@lovinjmaxwell5121
@lovinjmaxwell5121 2 жыл бұрын
Hi , I came across getx package for state management. What do you think about this package?
@FlutterExplained
@FlutterExplained 2 жыл бұрын
Hi Lovin, a lot of users of Flutter love getX and would recommend it. I personally be very careful with it. In my opinion a it is a anti pattern to have a package that tries to solve every problem. It is not only state management it is also routing, DI and more. It can be a great help to get something up and running, but if you search for long time solutions in a larger project I would not recommend it because the maintenance price tag could become quite large.
@alokkumarmaurya2231
@alokkumarmaurya2231 Жыл бұрын
👍👍
@user-wr4yl7tx3w
@user-wr4yl7tx3w 2 жыл бұрын
Is it like global variables in a way?
@FlutterExplained
@FlutterExplained 2 жыл бұрын
Great question! Not really, a global variable could contain state as for example Riverpod does. But Not all global variables are state. It is the state you want the program to be in if the global variable contains the background color, then yes it is your state of the background color. If you use the global variable only to contain information that you need for a calculation then no it is not really the state. I hope that helps.
@zstrizzel
@zstrizzel 11 ай бұрын
GetX?
@farseenabdulsalam6246
@farseenabdulsalam6246 3 жыл бұрын
1. Explanation of individual methods were very shallow. 2. Introduction wasnt concise. Over explained introduction. Very low signal to noise ratio.
@FlutterExplained
@FlutterExplained 3 жыл бұрын
Thank you for your feedback, we will try to improve that in the future.
@farseenabdulsalam6246
@farseenabdulsalam6246 3 жыл бұрын
@@FlutterExplained💙
Set State Method in Flutter - State Management Basics
13:25
Flutter Explained
Рет қаралды 23 М.
Flutter Redux - Single Source of Truth - State Management
19:46
Flutter Explained
Рет қаралды 18 М.
Я обещал подарить ему самокат!
01:00
Vlad Samokatchik
Рет қаралды 9 МЛН
50 YouTubers Fight For $1,000,000
41:27
MrBeast
Рет қаралды 211 МЛН
Can A Seed Grow In Your Nose? 🤔
00:33
Zack D. Films
Рет қаралды 24 МЛН
EVOLUTION OF ICE CREAM 😱 #shorts
00:11
Savage Vlogs
Рет қаралды 9 МЛН
Pragmatic State Management in Flutter (Google I/O'19)
33:25
Flutter
Рет қаралды 448 М.
Provider State management - ChangeNotifier + Flutter
18:28
Flutter Explained
Рет қаралды 27 М.
Files and Folder Structure in Flutter & Dart
20:23
Flutter Explained
Рет қаралды 18 М.
Flutter State Management Guide - What you need to know
8:57
Robert Brunhage
Рет қаралды 31 М.
Bloc Library - Painless State Management for Flutter
24:54
Reso Coder
Рет қаралды 91 М.
Flutter State Management - The Grand Tour
14:07
Fireship
Рет қаралды 239 М.
DHH discusses SQLite (and Stoicism)
54:00
Aaron Francis
Рет қаралды 57 М.
State Management Like A Pro - Flutter Riverpod
10:30
Robert Brunhage
Рет қаралды 76 М.
Я обещал подарить ему самокат!
01:00
Vlad Samokatchik
Рет қаралды 9 МЛН