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

КОМЕНТАРІ • 64

  • @EibeMandel
    @EibeMandel 4 роки тому +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 4 роки тому +4

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

  • @tessertaha
    @tessertaha 4 роки тому +6

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

  • @tonywright3777
    @tonywright3777 4 роки тому

    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 4 роки тому +1

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

  • @danvilela
    @danvilela 4 роки тому

    This was awesome! Thank you.

  • @divichuy2575
    @divichuy2575 4 роки тому +1

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

  • @RafaelDurelli
    @RafaelDurelli 4 роки тому

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

  •  4 роки тому +15

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

  • @Bathusaix
    @Bathusaix 4 роки тому

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

  • @mohamadosama9797
    @mohamadosama9797 4 роки тому

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

  • @motibartov3944
    @motibartov3944 4 роки тому

    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 4 роки тому

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

  • @venil82
    @venil82 4 роки тому

    How do you get those vertical lines in VScode?

  • @rakaalrian5659
    @rakaalrian5659 4 роки тому

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

  • @user-fh4xo2pc2d
    @user-fh4xo2pc2d 4 роки тому

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

  • @karianpour
    @karianpour 4 роки тому +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.

  • @SharpMentor
    @SharpMentor 2 роки тому

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

  • @ianoliveiradev
    @ianoliveiradev 4 роки тому

    very nice!!

  • @pedrosanchezroca181
    @pedrosanchezroca181 4 роки тому +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

  • @trongnghiaoan7984
    @trongnghiaoan7984 Рік тому

    What theme and fonts you used in your VSCODE?

  • @pembatamang8233
    @pembatamang8233 3 роки тому

    Mat: almost boilerplate free... imma head out

  • @naveenbharadwaj5059
    @naveenbharadwaj5059 2 роки тому +1

    what's your vsc theme ?

  • @sankaranarayananp8407
    @sankaranarayananp8407 4 місяці тому

    Can I use getit instead of provider ?

  • @amit.flutter
    @amit.flutter 3 роки тому +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

  • @augmentos
    @augmentos 4 роки тому

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

  • @akarshs9552
    @akarshs9552 4 роки тому +1

    Hey please upload more mobX contents

  • @punjabiwithjasman135
    @punjabiwithjasman135 4 роки тому

    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  4 роки тому +5

      It's in the process of creation 👨‍💻

    • @marcarch3872
      @marcarch3872 4 роки тому +1

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

  • @sumitaggarwal1164
    @sumitaggarwal1164 4 роки тому

    please make a video on flutter app using mobx with moor

  • @mrutyunjayagiri982
    @mrutyunjayagiri982 4 роки тому +1

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

    • @ResoCoder
      @ResoCoder  4 роки тому +5

      I'd recommend flutter_bloc.

  • @mrutyunjayagiri982
    @mrutyunjayagiri982 4 роки тому

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

  • @mabialaemile8541
    @mabialaemile8541 4 роки тому

    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 ?

  • @MoaazEid
    @MoaazEid 4 роки тому

    if anyone can help?

  • @vinothkumar-te6ui
    @vinothkumar-te6ui 4 роки тому

    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  4 роки тому

      What do you mean by more precise?

    • @vinothkumar-te6ui
      @vinothkumar-te6ui 4 роки тому

      @@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  4 роки тому +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 4 роки тому

      @@ResoCoder Thanks for the clarification

  • @bascelik91
    @bascelik91 4 роки тому

    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 4 роки тому +1

      I would like to know too.

    • @mallen1846
      @mallen1846 4 роки тому +2

      A lot less boiler plate from my experience

    • @d-apps2699
      @d-apps2699 4 роки тому

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

    • @mallen1846
      @mallen1846 4 роки тому +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 4 роки тому +1

      @@mallen1846 Thanks for sharing your experience.

  • @omicronx94
    @omicronx94 4 роки тому

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

  • @thomasmabika7291
    @thomasmabika7291 4 роки тому +2

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

    • @ResoCoder
      @ResoCoder  4 роки тому

      Looks intriguing.

    • @riyadhzenasni387
      @riyadhzenasni387 4 роки тому

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

  • @MoaazEid
    @MoaazEid 4 роки тому

    hello

  • @vrushangdesai2813
    @vrushangdesai2813 4 роки тому

    Hahah... so true , what about redux ?

  • @patricknasc
    @patricknasc 4 роки тому +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 Рік тому

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