Flutter MobX Tutorial - Transparent & Reactive State Management?

Sdílet
Vložit
  • čas přidán 27. 07. 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

Komentáře • 64

  • @EibeMandel
    @EibeMandel Před 4 lety +40

    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,
    }
    }

  • @nicolaszein
    @nicolaszein Před 4 lety +4

    Wonderful tutorial, love how you teach and the level of detail you provide. Can't thank you enough.

  • @tessertaha
    @tessertaha Před 4 lety +6

    Perfect timing, i really wanted a good video on Mobx!

  • @tonywright3777
    @tonywright3777 Před 4 lety

    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.

  • @user-fh4xo2pc2d
    @user-fh4xo2pc2d Před 4 lety +1

    Your tutorial is really helpful. I hope you make use of mobx more later on.

  • @danvilela
    @danvilela Před 4 lety

    This was awesome! Thank you.

  • @divichuy2575
    @divichuy2575 Před 4 lety +1

    Nice, you should share more Mobx, i love Mobx.

  •  Před 4 lety +15

    Reso, can you think about write an article about TDD Clean Code Architecture using MOBX ?

  • @pembatamang8233
    @pembatamang8233 Před 3 lety

    Mat: almost boilerplate free... imma head out

  • @RafaelDurelli
    @RafaelDurelli Před 4 lety

    Nice video. Thanks a lot. I think would be nice to make a serie chopper and mobx. ;)

  • @mohamadosama9797
    @mohamadosama9797 Před 4 lety

    Thanks bro ... please make tutorial for mobx 😁😁

  • @akarshs9552
    @akarshs9552 Před 4 lety +1

    Hey please upload more mobX contents

  • @SharpMentor
    @SharpMentor Před 2 lety

    Can you please make one video on getx with clean architecture..

  • @ianoliveiradev
    @ianoliveiradev Před 4 lety

    very nice!!

  • @Bathusaix
    @Bathusaix Před 4 lety

    hello great tutorial this ... could you tell me if you can use mopbx with freezed? or are they incompatible?

  • @pedrosanchezroca181
    @pedrosanchezroca181 Před 4 lety +1

    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

  • @motibartov3944
    @motibartov3944 Před 4 lety

    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

  • @drdDavi
    @drdDavi Před 4 lety

    Excellent video, but why should I choose MobX over provider? Provider seems easier to reason with... Can I have your thoughts.

  • @karianpour
    @karianpour Před 4 lety +1

    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.

  • @venil82
    @venil82 Před 4 lety

    How do you get those vertical lines in VScode?

  • @naveenbharadwaj5059
    @naveenbharadwaj5059 Před 2 lety +1

    what's your vsc theme ?

  • @trongnghiaoan7984
    @trongnghiaoan7984 Před rokem

    What theme and fonts you used in your VSCODE?

  • @rakaalrian5659
    @rakaalrian5659 Před 4 lety

    is Mobx have something like Hydrated Bloc to save the current state?

  • @user-fh4xo2pc2d
    @user-fh4xo2pc2d Před 4 lety

    Would you cover flutter_screenutil plugin later? I want to know your thoguhts on it.

  • @augmentos
    @augmentos Před 4 lety

    would love a min state managment lib like most core or bacon

  • @amit.flutter
    @amit.flutter Před 3 lety +1

    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

  • @sankaranarayananp8407
    @sankaranarayananp8407 Před 4 měsíci

    Can I use getit instead of provider ?

  • @punjabiwithjasman135
    @punjabiwithjasman135 Před 4 lety

    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

    • @ResoCoder
      @ResoCoder  Před 4 lety +5

      It's in the process of creation 👨‍💻

    • @marcarch3872
      @marcarch3872 Před 4 lety +1

      @@ResoCoder A Firebase video using Clean Code Arch will be awesome. Thanks for your effort is really appreciated

  • @sumitaggarwal1164
    @sumitaggarwal1164 Před 4 lety

    please make a video on flutter app using mobx with moor

  • @mrutyunjayagiri982
    @mrutyunjayagiri982 Před 4 lety +1

    Bloc RxDart or Flutter_bloc or MobX(new for me). So Which You Will Recommend.

    • @ResoCoder
      @ResoCoder  Před 4 lety +5

      I'd recommend flutter_bloc.

  • @mabialaemile8541
    @mabialaemile8541 Před 4 lety

    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 ?

  • @mrutyunjayagiri982
    @mrutyunjayagiri982 Před 4 lety

    Hi. Please Make A Tutorial about Responsive Layout Like On Different Resolution and Size.

  • @vinothkumar-te6ui
    @vinothkumar-te6ui Před 4 lety

    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?

    • @ResoCoder
      @ResoCoder  Před 4 lety

      What do you mean by more precise?

    • @vinothkumar-te6ui
      @vinothkumar-te6ui Před 4 lety

      @@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

    • @ResoCoder
      @ResoCoder  Před 4 lety +2

      @@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.

    • @vinothkumar-te6ui
      @vinothkumar-te6ui Před 4 lety

      @@ResoCoder Thanks for the clarification

  • @MoaazEid
    @MoaazEid Před 4 lety

    if anyone can help?

  • @omicronx94
    @omicronx94 Před 4 lety

    It's a good video but nowhere near the typical MobX usage in an app e.g. using lists and multiple screens.

  • @thomasmabika7291
    @thomasmabika7291 Před 4 lety +2

    check out states_rebuilder, might really be one of the best state management solution.

    • @ResoCoder
      @ResoCoder  Před 4 lety

      Looks intriguing.

    • @riyadhzenasni387
      @riyadhzenasni387 Před 4 lety

      @@ResoCoder I know states_rebuilder creator in case you want more insights

  • @bascelik91
    @bascelik91 Před 4 lety

    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 :)

    • @d-apps2699
      @d-apps2699 Před 4 lety +1

      I would like to know too.

    • @mallen1846
      @mallen1846 Před 4 lety +2

      A lot less boiler plate from my experience

    • @d-apps2699
      @d-apps2699 Před 4 lety

      @@mallen1846 Thank you. I will try mobx later. Maybe I'll change from bloc to mobx as my state manager

    • @mallen1846
      @mallen1846 Před 4 lety +5

      @@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.

    • @d-apps2699
      @d-apps2699 Před 4 lety +1

      @@mallen1846 Thanks for sharing your experience.

  • @MoaazEid
    @MoaazEid Před 4 lety

    hello

  • @vrushangdesai2813
    @vrushangdesai2813 Před 4 lety

    Hahah... so true , what about redux ?

  • @patricknasc
    @patricknasc Před 4 lety +1

    i dont no about yall, but I still prefer Provider or even BloC than this option. To much complexity for same result.

  • @sergeykodzha2621
    @sergeykodzha2621 Před rokem

    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))`