GetX vs Riverpod | Which is better with Flutter❓

Поделиться
HTML-код
  • Опубликовано: 13 июн 2024
  • I studied both the packages in detail and made a comparison video to understand which one is better state management tool with Flutter.
    Chapters 👇🏼
    0:00 - Introduction
    0:28 - Size comparison
    4:05 - Performance comparison
    11:15 - Code comparison
    If you like my work
    Buy me coffee on : ko-fi.com/afzalali15
    Join this channel to get access to perks:
    ruclips.net/user/CodeXDevjoin
    Gears ========
    Camera 📸 || Canon 250D : amzn.to/34isdKr
    Mic 🎤 || Maono AU-04 : amzn.to/341g9wS
    #CodeX
    Connect with me on social media:
    FB: / codexdevs
    Twitter: / afzalali_dev
    LinkedIn: / afzalali15
    Discord: / discord

Комментарии • 139

  • @devio9699
    @devio9699 Год назад +13

    I just published a financial application developed with GetX. I don't feel any issues with GetX till now.

    • @CodeXdev
      @CodeXdev  Год назад +6

      Exactly, We have published a complete bank application with WesternUnion and many third party payment gateways.
      All with Flutter and GetX.
      It’s more like how you utilise the tool rather than going with super duper awesome packages.

  • @faizandarwesh7867
    @faizandarwesh7867 Год назад +1

    Awesome content. These internal details are so helpful. Thanks a lot.

  • @pranavkhote
    @pranavkhote 2 года назад +24

    I have used Getx more often in commercial projects as it is easy to understand and write code once you get use to it due to its easy structure

    • @CodeXdev
      @CodeXdev  2 года назад +3

      Thats why its most liked package on pub.dev

    • @ajaykotiyal427
      @ajaykotiyal427 Год назад

      Highly commercial Apps use BloC - I think. Because it is more organized.

    • @MuhammadZeeshan-uc2bg
      @MuhammadZeeshan-uc2bg Год назад +1

      @@ajaykotiyal427 which specific commercial app you personally know that uses Bloc? :)

    • @saqibshafin
      @saqibshafin Год назад +1

      @@MuhammadZeeshan-uc2bg In my job search experience on Upwork, I often saw Bloc usage as one of the client requirements. I think NA and EU dev teams prefer Bloc. Never saw Getx.

    • @fabianm5960
      @fabianm5960 Год назад

      @@CodeXdev i would say most of the likes aren't real. I mean, come on, more likes than Cupertino or provider ? I don't think this can't be legit

  • @vibhor691
    @vibhor691 Год назад +12

    If someone only uses Getx then he will definitely forget about how flutter actually works behind the code, like how context is passed and when you're using Getx it's basically like moving to different mini framework inside the app itself. I recommend switching between bloc, riverpod, getx

    • @CodeXdev
      @CodeXdev  Год назад +2

      I totally agree with you, we should know how Flutter works with context.

    • @Mfbzai
      @Mfbzai Год назад

      How about provider, is it same?

    • @BrunoCodeman
      @BrunoCodeman Год назад +3

      @@Mfbzai provider is kinda the old version of riverpod.

    • @arieagung
      @arieagung 9 месяцев назад

      GetX is how flutter framework should be.

    • @Apenschi
      @Apenschi 4 месяца назад

      @@BrunoCodeman Riverpod was an improved version of Provider. But now Riverpod is degenerating quickly, becoming more and more complex and abstratc. So in my opinion Provider gets more interesting again as an alternative to Riverpod.

  • @hoekbrwr
    @hoekbrwr Год назад +3

    The controller is tight to a screen means the Business logic is not separate from the View. Better to state that when needing a reactive variable is needed you have to find the controller which was created on another screen when needed on more than one screen.

  • @nthonyproblgomez9659
    @nthonyproblgomez9659 2 года назад

    Thanks for the video. ❤️ From Bangladesh

  • @ibrahemtaha8177
    @ibrahemtaha8177 2 года назад +1

    amazing video!! many thanks for sharing! 🔥🔥🔥
    how about Bloc vs Getx vs Redux flutter?
    Thanks in advance!
    🙏

  • @mohamdjamal6266
    @mohamdjamal6266 2 года назад

    Hi when we need nested navigation, so i case i develop Ecommerce for web and bobile?

  • @saeedrazazzadeh9114
    @saeedrazazzadeh9114 2 года назад

    Thank you for your videos
    Best regard...

    • @CodeXdev
      @CodeXdev  2 года назад +1

      Glad you like them!

  • @noman7776
    @noman7776 2 года назад

    Thanks Afzal, which vscode theme are you using ?

  • @user-nu2nj7mf2z
    @user-nu2nj7mf2z 2 года назад +2

    Hey Afsal. Make a Getx Controller in separated package please
    it looks very nice for managing state option

  • @pragnabhatt9531
    @pragnabhatt9531 Год назад

    excellent explanation

  • @buck-johnson
    @buck-johnson 2 года назад +16

    Great video. I went into it liking Provider but came out liking Getx. The last segment showing the code side by side was more important and should have been weighted greater. I think for that Getx should've got 2 points. Just as you said, having a controller for each page makes coding much easier.

  • @jaimepremy
    @jaimepremy 2 года назад +15

    I'm totally sold on GetX, my only concern is the same of some others here: maintenance of the the package in the long run. I guess the only way to ensure this is to have more and more contributions from the community.

  • @tripurarishankartiwari3698
    @tripurarishankartiwari3698 2 года назад

    good comparison, both good

  • @ajaykotiyal427
    @ajaykotiyal427 Год назад +2

    I have applied Riverpod in a project. It is very flexible. but sometimes a provider depends on another one is not easy to understand (e.g. FutureProvider will depend on some StateProvider for API calling). And we will have to define global providers for each and every action, this can be a Drawback. But Overall it reduces so much boiler plate code. I am in favour of it.
    But I don't have experience with GetX, so cannt say anything.

  • @1kjm
    @1kjm 2 года назад +2

    Can you benchmark riverpod against redux?

  • @jrheisler
    @jrheisler 2 года назад +5

    I use getx in all my projects. I'm concerned though that with no updates in 3 months, and the beta now 9 days old... Btw, one of my main projects can't recompile with the latest flutter... It does make one worry.

    • @Apenschi
      @Apenschi 4 месяца назад

      Similar problems with Riverpod. I'm using ChangeNotifierProvider a lot because I don't like to work with immutable data . Now it seems to be kind of deprecated in Riverpod. Also they seem to want to force you into code generation what I don't like, too. So after have been working with Riverpod for several years, in several large projects, I'm now having the problem that Riverpod might not fit my development anymore and I might end up to need to migrate all the Riverpod code what would be more than annoying. So it is always a problem and risk when you depend so much on a single package!

  • @user-wr4yl7tx3w
    @user-wr4yl7tx3w 2 года назад +1

    Should using GetX create issues with iOS simulator? Not sure if I ran into issues that was connected to GetX.

    • @CodeXdev
      @CodeXdev  2 года назад +1

      Nope, GetX has nothing to do with it! May be its ur system?

  • @thegospellight
    @thegospellight 2 года назад

    good videos. thanks

  • @ai_malllu
    @ai_malllu 2 года назад +1

    hey ...i am bit confused. with state management ,which to choose as i am beginner ...do i need to learn all state management to get a a job? or just one? & expecting suggestion from flutter community

    • @CodeXdev
      @CodeXdev  2 года назад +2

      You need to understand Flutter and any one of the state management, preferably BLoC for interview perspective. rest all you can learn as and when needed

    • @ai_malllu
      @ai_malllu 2 года назад

      @@CodeXdev thanks bro & your contents are much helpful..waiting for more

  • @chrisodonnell86
    @chrisodonnell86 2 года назад

    Hey if I use Getx and fluent_UI, I wouldn’t use GetMaterialApp right? Just use it for state management not routing/utils?

    • @CodeXdev
      @CodeXdev  2 года назад +2

      No, theres more to it. If you need only GetxController and .obs then you don't need GetMaterialApp at all.. but if you use Get.width, Get.dialog, Get.anything then you have to make it GetMaterialApp!

    • @rudiansyahalpontianaky8356
      @rudiansyahalpontianaky8356 Год назад

      Thanks i get it

  • @7mada89
    @7mada89 2 года назад +13

    I have to say this, Provider, Riverpod or Bloc would be faster than GETX because flutter by default is optimized to use InheritedWidget.
    In the documentation of inheritFromWidgetOfExtactType "Calling this method is O(1) with a small constant factor", but it wouldn't be noticeable in small app.
    One more thing is that you can use ChangeNotifier instead of StateNotifier if you want to use something like MVC architecture. other than the video is great, both are good solutions and every solution have some downsides.

    • @CodeXdev
      @CodeXdev  2 года назад +1

      Thank you for writing descriptive feedback, Consumer and Obx both are Stateful widget behind the scene.. I think its more about how that setState is triggered internally in these widgets and how changes are notified.

  • @sharathbnaik3232
    @sharathbnaik3232 2 года назад +4

    Hi...
    I'm using getx from long time and beginner also to flutter . But i while surfing on internet i read some articles about state management. The flutter community and industry level companies are prefer to use bloc package for state management.
    1. Why they not prefer to use getx ?.
    2. Why they prefer bloc ?
    3. Which is good for next carrier.
    💕 from india.

    • @gaxkiller
      @gaxkiller 2 года назад +6

      I never see getx used in production code here in France.

    • @kecudotcom
      @kecudotcom 2 года назад +5

      in Indonesia some big tech companies use GetX.

    • @jayminpatel8753
      @jayminpatel8753 2 года назад +1

      For big companies it is not easy move their products from bloc to any other state management. And bloc is here from the beginning so that's why they asked for bloc. But recommend to go with Getx. We used for our products as well.

    • @gaxkiller
      @gaxkiller 2 года назад

      @@jayminpatel8753 I don't know, but here I never heard of someone recomanding to use getX. If they move from bloc it is most of the time for riverpod

    • @banuacoder
      @banuacoder Год назад +2

      In Indonesia, I have some of my projects with my clients using GetX and it worked perfectly fine

  • @rahulagarwal968
    @rahulagarwal968 Год назад

    When to use Sql vs NoSql database. Everywhere its told that use SQL database when you have structured data. But when building any app, most of the time data are related to each other. So in that case as a beginner I get confused which to use when and why ?

    • @arieagung
      @arieagung 9 месяцев назад +2

      NoSQL requires code to make sure the data consistency. Complex data models if you need to make a report or any data analysis.
      Most of time SQL is good fit for general use.

    • @Apenschi
      @Apenschi 4 месяца назад

      There are two reasons why NoSql has been so successful recently: 1. Many new developers, especially self-tought ones, try to avoid SQL because it is much more complicated 2. Most app are rather primitive, so in fact NoSQL is sufficient for the majority of the apps developed. BUT if your data structures get more complex your requests will also get more complex and then you will be lucky if you chose SQL because it is MUCH more powerful and database engines are MUCH more optimized. I would always recommend using SQL. There is only one real reason for using NoSql that is when you have lots of relatively unstructured data.

  • @tiktik1516
    @tiktik1516 2 года назад

    Neat mahn...Flutter community!

  • @arunflik6943
    @arunflik6943 Год назад

    which is better for ecommerce app development getx or provider or riverpod or Bloc ?

    • @atati
      @atati Год назад

      They all have their downsides and advantages, depends with what exactly you want to achieve

  • @abror_khurramov
    @abror_khurramov 2 года назад +2

    Hi bro, why you don't use ExampleClass extends GetView and Getbuilder instead of Obx , is it more convenient. or is there a drawbacks of this. if you know please explain i am still junior

    • @CodeXdev
      @CodeXdev  2 года назад

      Yeah, I should have used it.. but while recording I missed it

    • @kecudotcom
      @kecudotcom 2 года назад

      I prefer use Getview and StateMixin. They are simple and easy to use

  • @Isthiyaquekambathagothi
    @Isthiyaquekambathagothi 2 года назад

    How do we run iOS on Windows, does it only work with MacOS? how do developer with Windows build iOS or release build iOS files? is there a solution for windows? android am able to build but not iOS

    • @CodeXdev
      @CodeXdev  2 года назад +1

      Single answer for all of ur question:
      Its not possible!
      You need MacOS 🖥 with XCode installed to build iOS app.

    • @Isthiyaquekambathagothi
      @Isthiyaquekambathagothi 2 года назад

      @@CodeXdev Thank you so much, and can you do a video on Dio for api with getx, i have seen http, not sure if you have done.. Love your videos and channel ..Keep doing

  • @arupnaskarbkp
    @arupnaskarbkp 2 года назад +1

    I love Getx

  • @MuhammadAdnan-vs5cx
    @MuhammadAdnan-vs5cx 2 года назад

    Bro getx v provider which is best?

    • @CodeXdev
      @CodeXdev  2 года назад

      Whatever seems easy to you...

  • @sumanmitraYTC
    @sumanmitraYTC 2 года назад +2

    Getx no doubt has all the features and are well planned so it fires up only when u use the functionality (like storage or navigation) but I feel in a long run if our total app is based on Getx and something has to go wrong with the package we will be screwed... I love minimalism so use only package that has sole purpose... Anyway good comparision..

  • @AdamSowinski
    @AdamSowinski Год назад +3

    I would choose Riverpod over any other state management solution. Regarding GetX, the syntax look awful.

  • @jailsoncarneiro4936
    @jailsoncarneiro4936 2 года назад

    Bacana!

  • @shahidwani6445
    @shahidwani6445 Год назад

    Sir make video on objectbox

  • @laughone
    @laughone 2 года назад

    where do i get certification for free in flutter?

    • @rwuttke
      @rwuttke Год назад

      Just remember if you get it for free, then you get what you paid for.

  • @siddharthmehra5796
    @siddharthmehra5796 2 года назад +2

    No matter what, GetX ❤

    • @CodeXdev
      @CodeXdev  2 года назад +1

      Thats called blind love ❤️ 😉

  • @chrisodonnell86
    @chrisodonnell86 2 года назад +2

    I’m going to give GetX a crack for my next app, was going to try riverpod but the evidence of GetX just keeps adding up! Ps from a provider background

  • @bayhasaroob2912
    @bayhasaroob2912 2 года назад

    you need more info about riverpod ,most of information in last section was wrong

    • @CodeXdev
      @CodeXdev  2 года назад

      Successfully read and ignored 😬

  • @zakariahossain3455
    @zakariahossain3455 2 года назад +1

    What about unit testing comparison?

  • @MoAdel92
    @MoAdel92 2 года назад

    we need more details on fixing janks
    i couldn't find good resourses

  • @intuneknight9681
    @intuneknight9681 2 года назад +2

    Why the flutter team didn't implement the state management like this libraries from the ground up and make it so painful since day one ?

  • @chrisodonnell86
    @chrisodonnell86 2 года назад

    Next video- Fluent UI & GetX web/desktop app plsssssssss 🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙂

    • @CodeXdev
      @CodeXdev  2 года назад +1

      I have plans for Web and desktop application with Flutter.. will try how Fluent UI goes with it.

    • @chrisodonnell86
      @chrisodonnell86 2 года назад

      @@CodeXdev nice! Would be cool to see Fluent UI, there are a few material web/desktop vids but I haven’t seen a good fluent UI video in English yet.

  • @hajajmaor
    @hajajmaor 9 месяцев назад

    Some things were presented wrong.
    You have a Consumer widget, to wrap only part of the widget. You didn't dispose the text editing controller. And I haven't finished the video yet.
    You didn't declare the data in a provider.
    You can hold the query in a provider and read from there.

  • @mrwaseemmalik5766
    @mrwaseemmalik5766 Год назад

    Please fight between getx and bloc

  • @mustafashaikh7829
    @mustafashaikh7829 2 года назад

    What about provider.?

    • @CodeXdev
      @CodeXdev  2 года назад +2

      Riverpod is evolved version of provider 😃

    • @devzeeshan3637
      @devzeeshan3637 2 года назад +1

      @@CodeXdev yeah agreed 👍🏻

    • @mustafashaikh7829
      @mustafashaikh7829 2 года назад

      @@CodeXdev then I will stick to provider

    • @unknownunicorn1373
      @unknownunicorn1373 2 года назад +1

      @@CodeXdev It’s not. Riverpod is a rewrite based on Provider, but it is not using Provider internally. Riverpod does not place providers in the widget tree like Provider does using InheritedWidget. Riverpod has it's own storage for providers "ref" so that it is not tied to the BuildContext

    • @CodeXdev
      @CodeXdev  2 года назад

      @@unknownunicorn1373 Agreed, what I meant is provider evolved to Riverpod so there is no need to go back and compare with provider, in context of question.

  • @mazenalsakkaf
    @mazenalsakkaf 2 года назад +2

    I 👍riverpod
    According to the official documentation:
    Riverpod is a complete rewrite of the Provider package to make improvements that would be otherwise impossible.

    • @CodeXdev
      @CodeXdev  2 года назад +1

      No doubt.. Riverpod is a good library.

    • @Apenschi
      @Apenschi 4 месяца назад

      Riverpod was an improved version of Provider. But now Riverpod is degenerating quickly, becoming more and more complex and abstratc. So in my opinion Provider gets more interesting again as an alternative to Riverpod.

  • @tiktik1516
    @tiktik1516 2 года назад +2

    Getx is very simple and calm.. don't need any high logic and pro methods.

    • @CodeXdev
      @CodeXdev  2 года назад

      indeed its simple and very productive.

  • @DholaSain
    @DholaSain Год назад +1

    Why people hate GetX sooo much?

  • @sosualfred
    @sosualfred 2 года назад +8

    GetX Wins once again.

  • @dolbysoundsofficial9323
    @dolbysoundsofficial9323 2 года назад +1

    I love to use Riverpod you dont show .listen .refresh .autodispose n .when .maybeMap you just show some basic stuff even you dont no how to use Riverpod in better way

    • @CodeXdev
      @CodeXdev  2 года назад

      Appreciate your comment, but this video was not to show what all features Riverpod or GetX have. Its about comparing which takes what resources and is it good to use or not.

  • @codegambit2507
    @codegambit2507 2 года назад

    Unit test comparison?

    • @CodeXdev
      @CodeXdev  2 года назад

      That would be whole new video..

  • @naxcall
    @naxcall Год назад

    Riverpod gang 👍

  • @hmathiralazad5680
    @hmathiralazad5680 2 года назад

    Using Get CLI with GetX -_-

    • @CodeXdev
      @CodeXdev  2 года назад

      It was love at first sight..

  • @walrider7374
    @walrider7374 Год назад

    Small project? Provider or Riverpod
    Big project? Bloc
    Javascript bringing sh1t bad practices to Flutter? GetX

  • @jithu8794
    @jithu8794 2 года назад +2

    Its better to switch to riverpod, getx is no longer maintained - that's a serious issue

    • @CodeXdev
      @CodeXdev  2 года назад +4

      Stable version 4.6.1 came 3 months back, but if you see prerelease 5.0.0 was updated 14 days back.. so it’s fine! 😉

  • @ProyectoViernes
    @ProyectoViernes Год назад

    Riverpod es mas flexible.

  • @moazahmed5388
    @moazahmed5388 2 года назад

    another "tie" type comparison video :/

    • @CodeXdev
      @CodeXdev  2 года назад

      tbh, we can't just say one approach is better than other.. we can only put our perspective and people will decide themselves what suits best.
      I tried my best to keep the points clear and tell my opinion about GetX and Riverpod.
      being said that both authors have done amazing job, its matter of choice what you prefer.
      For me GetX seems easy and quick to implement.

    • @moazahmed5388
      @moazahmed5388 2 года назад

      @@CodeXdev ik man and thanks for the video , but there is another "perspective" to mention here , Get lets you depends on it to almost easily forget what's the purpose of simple features in Flutter , like : Stateful Widgets , ScaffoldMessenger , ModalSheets , and the list goes on , i can't remember the last time i had to use a stful widget just for animation because of the TickerProviderStateMixin , i'm a Get user and GOD help me , i miss Provider tho

  • @toastytheloafdog
    @toastytheloafdog 2 года назад

    Bloc.

  • @saabirmohamed636
    @saabirmohamed636 2 года назад +8

    personally I've use all bloc, provider , riverpod and GETX is simply the best in my opinion, whether you just use the state management or not ....and the CLI GETX provides makes things really easy and professional even at scale.
    and another thing is that the Obx() widget is the coolest thing ever ...in theory you never have to have a class that is a stateful widget ever..the Obx() widget targets the build method already built into the widget itself, which ALL widgets in flutter have, by design ...think of it like this, a build method only running once only where it needs to run. so the tree gets untouched. Only that single widget that needs to update re-builds alone...(that is far more efficient and elegant)
    if you have a a column widget in theory no matter how many other widgets are in the column only the 1 widget you need to react inside will update...to me that's simply perfect, with so little boiler plate.
    give getx a try I absolutely love it. (and there is soooo much more...read the docs a few minutes of your time)
    In A PERFECT world , google would announce that all other state management methodologies should be deprecated and only GETx be used for for the fast targeted way it runs each widgets build method individually.

    • @codegambit2507
      @codegambit2507 2 года назад +2

      You should really rethink your choices if google themselves are favouring Bloc, Provider and Riverpod over Getx

    • @mdmahadyhasan6683
      @mdmahadyhasan6683 2 года назад

      @@codegambit2507 there is a reason why getx has so many likes :)

    • @codegambit2507
      @codegambit2507 2 года назад

      @@mdmahadyhasan6683 yeah because it's easier for beginners to get started with Getx as a state management in flutter.
      Most devs who have been using flutter for at least 2 years would never pick Getx over Riverpod. No Google dev will ever pick Getx over Riverpod. That should tell you something.

    • @codegambit2507
      @codegambit2507 2 года назад +2

      @@mdmahadyhasan6683 polularity alone shouldn't be your only reason of choosing something

    • @mdmahadyhasan6683
      @mdmahadyhasan6683 2 года назад +5

      @@codegambit2507 well im using flutter since beta days. I have used provider , bloc , getx , riverpod and getx is the most convenient for me for production application. Its easy with get_cli , built in mvc architecture and have loads of utilities that otherwise has to be installed via pub. No google dev will pick getx ? are u a google dev or something? dont assume anything without concrete proof.

  • @Trancecend
    @Trancecend Год назад

    Just be aware that global scoped ANYTHING is a horrible practise in programming. It's akin to static calls: Anything is accessable by everything. So 👎🏻 riverpod. For both I'm calling YAGNI: en.wikipedia.org/wiki/You_aren%27t_gonna_need_it