Flutter MobX Tutorial - Transparent & Reactive State Management?
Вставка
- Опубліковано 22 лип 2024
- 📗 Learn from the written tutorial & get the starter project 👇👇
resocoder.com/flutter-mobx
📧 Get Flutter news 📰 and resources:
👉 flutter.education
👨💻 Do you write good code? Find out now!
resocoder.com/good-code-quiz
Not a day goes by without a heated debate taking place somewhere in the comments about the best state management solution. MobX is one of them. Originating in the JavaScript world, it has found a way to Dart. Unlike most of the other state management libraries, MobX heavily relies on code generation which allows you to write really powerful, yet almost boilerplate free code.
State management is best learned on real(ish) projects. As is a bit of a tradition on Reso Coder, we're going to build a weather forecast app.
Go to my website for more information, code examples, and articles:
● resocoder.com
Follow me on social media:
● / resocoder
● / resocoder
● / resocoder
If you guys want to keep your workspace clean add this to your settings in VS Code to hide all the generated files:
{
"files.exclude": {
"**/*.g.dart": true,
}
}
This has to be added in the Add Pattern?
Wonderful tutorial, love how you teach and the level of detail you provide. Can't thank you enough.
Perfect timing, i really wanted a good video on Mobx!
Mate this is so helpful, thanks heaps. Exactly the clarifications and detail I needed. Love that observable future, I was doing it the state = _ way up until 5 minutes ago.
Your tutorial is really helpful. I hope you make use of mobx more later on.
This was awesome! Thank you.
Nice, you should share more Mobx, i love Mobx.
Nice video. Thanks a lot. I think would be nice to make a serie chopper and mobx. ;)
Reso, can you think about write an article about TDD Clean Code Architecture using MOBX ?
That would be really nice ;)
hello great tutorial this ... could you tell me if you can use mopbx with freezed? or are they incompatible?
Thanks bro ... please make tutorial for mobx 😁😁
Hi, thanks for this video Reso!
Would you recommend making the page a child of a Consumer which is a child of the Provider?, by this you can provide the store in the widget page constructor? by this you wouldn't need to get it in the didChangeDependencies
Excellent video, but why should I choose MobX over provider? Provider seems easier to reason with... Can I have your thoughts.
How do you get those vertical lines in VScode?
is Mobx have something like Hydrated Bloc to save the current state?
Would you cover flutter_screenutil plugin later? I want to know your thoguhts on it.
Nice.
Imagine that you want to persist the store. How would you do that, as you used the Future.fulfiled for storeState? Personally I did not like that idea, I like the store to be as simple and plain as possible.
Can you please make one video on getx with clean architecture..
very nice!!
ua-cam.com/video/EgATS_Ew1N8/v-deo.html
dont know if it is just me but I find this MobX way way way more complicated than Bloc....Bloc is just so nice and clean Evet --> Bloc --> State
What theme and fonts you used in your VSCODE?
Mat: almost boilerplate free... imma head out
what's your vsc theme ?
Can I use getit instead of provider ?
hello, sir can you make new videos on MOb x because there is no power video available for beginners and all methods and syntax are totally new in flutter 2.0
would love a min state managment lib like most core or bacon
Hey please upload more mobX contents
Hi sir ! Thanks for this great content.....
One request can u please make a series on making a complete app with firebase as its backed
It's in the process of creation 👨💻
@@ResoCoder A Firebase video using Clean Code Arch will be awesome. Thanks for your effort is really appreciated
please make a video on flutter app using mobx with moor
Bloc RxDart or Flutter_bloc or MobX(new for me). So Which You Will Recommend.
I'd recommend flutter_bloc.
Hi. Please Make A Tutorial about Responsive Layout Like On Different Resolution and Size.
ua-cam.com/video/EgATS_Ew1N8/v-deo.html
I love your videos they're very nice :) . I'm trying to follow your path.... So I decided to make a website.... It's done ... But I would like to know... Where do you host your website ?
MDD Hosting
@@ResoCoder thank you :)
if anyone can help?
MobX seems way more precise when compared to BLoC which is really helpful in long run. Can you compare both about their advantages and disadvantages?
What do you mean by more precise?
@@ResoCoder Number of lines required to achieve same thing looks like really less when compared to BLoC. Also it becomes complex when number of files (1 Event, 1 State and 1 BLoC per screen) increases in BLoC if the project size is huge
@@vinothkumar-te6ui Yes, there's less boilerplate but I'd argue that there's also less straightforwardness. Bloc outputs *new* states while MobX just mutates state.
@@ResoCoder Thanks for the clarification
Why Mobx and states rebuilder are better than Bloc for state management? Can somebody give me a good example in order to understand it? Thanks :)
I would like to know too.
A lot less boiler plate from my experience
@@mallen1846 Thank you. I will try mobx later. Maybe I'll change from bloc to mobx as my state manager
@@d-apps2699 I have an average sized project I have been developing and I have struggled with architecture so over the past year I have recreated the project using just about every state management package out there, observable_state, flutter_bloc, scoped_model, redux and several others and today I find MobX and States Rebuilder to both very easy to implement and use. Currently I am leaning more towards MobX.
@@mallen1846 Thanks for sharing your experience.
It's a good video but nowhere near the typical MobX usage in an app e.g. using lists and multiple screens.
check out states_rebuilder, might really be one of the best state management solution.
Looks intriguing.
@@ResoCoder I know states_rebuilder creator in case you want more insights
hello
ua-cam.com/video/EgATS_Ew1N8/v-deo.html
Hahah... so true , what about redux ?
i dont no about yall, but I still prefer Provider or even BloC than this option. To much complexity for same result.
for ones who are looking store template for Android Studio:
import 'package:mobx/mobx.dart';
part '$NAME$_store.g.dart';
class $CNAME$Store extends _$CNAME$Store with _$$$CNAME$Store {}
abstract class _$CNAME$Store with Store {
@observable
int value = 0;
@action
void increment() {
value++;
}
}
When adding set experssion for 'CNAME` var to `capitalize(underscoresToCamelCase(NAME))`