#23 || Flutter GetX Tutorial || Fetch API Data with GetConnect & StateMixin in GetX

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ก.พ. 2025

ความคิดเห็น • 74

  • @LeagueRandomPlayer
    @LeagueRandomPlayer 4 ปีที่แล้ว +4

    Your explanation is very complete, its the way i like to be taught, with a LOT of explanation. You Sr have your like and please keep this coming specially getX ones

  • @msharma-r4s
    @msharma-r4s ปีที่แล้ว

    Thanku so much sir , I have implemented getx in my projects by learning from your videos

  • @ebenezerferguson3756
    @ebenezerferguson3756 3 ปีที่แล้ว +12

    Really good tutorial. One thing though, can you use a less distracting theme for your computer next time please.?

  • @panchalravi5838
    @panchalravi5838 2 ปีที่แล้ว

    Superb Explain 😎💻📲🔥

  • @salahadindinsafa7657
    @salahadindinsafa7657 2 ปีที่แล้ว

    an essential thing in a simple way thanks omer

    • @ripplescode
      @ripplescode  2 ปีที่แล้ว

      It's not omer it's Amar

  • @leobudihartokusumo2049
    @leobudihartokusumo2049 3 ปีที่แล้ว

    At the model dart file generated, you must manually change the "Class ?" into "Info ?" or "Name ?" or "Dob ?" according to the classes name created by get_cli 1.6.0 (see the below part of the model dart file).
    Somehow the get generate model can create the correct Info class, Name class, Dob class etc but can not MAP them correctly into their class definition name at the top part of the model dart file (it just simply write it as "Class ?" which mean we must look at the correct corresponding "class name" in the bottom part of the model dart file).
    Example: Change "manually by yourselves" the:
    Class? info
    Class? login;
    Class? dob;
    Class? registered;
    into
    Info? info

    Login? login;
    Dob? dob;
    Dob? registered;
    then it will work. Notice that the dob and registered json sample file have exactly the same data structure so the get_cli only make 1 new class called "Dob class" so you have to use Dob for "dob" variable and also for "registered" variable (the get_cli is smart enough not making new "Registered class" as it detect it have the same data structure as the "Dob class" it already made inside the model dart file).
    Also, add "!" (the null check) in some part of the model dart file created by get_cli (as get_cli somehow maybe not fully comply yet with the "null safety" feature of the new flutter version.
    Example: at:
    results.add(Results.fromJson(v));
    change it into
    results!.add(Results.fromJson(v));
    After doing the two things above then the model dart file will no longer produce errors.

  • @amirvahedix_dev
    @amirvahedix_dev 3 ปีที่แล้ว

    So useful, thanks for this great playlist!

  • @thisaragunasekara924
    @thisaragunasekara924 3 ปีที่แล้ว +1

    After clone the project it says my app is not defind that error occurs in test folder under widget test dart
    Im.using flutter 2.51

    • @thisaragunasekara924
      @thisaragunasekara924 3 ปีที่แล้ว +1

      Also in user models .dart
      There is a msg says
      List is deprecated and shouldnt use. How to fix this

    • @thisaragunasekara924
      @thisaragunasekara924 3 ปีที่แล้ว

      Resolved it

  • @veedfriendforever5990
    @veedfriendforever5990 3 ปีที่แล้ว +1

    sir please use model also with this use create but not use mode you directly call the properties from response. so please make it also we can understand. and up to this you r really very important. regard getx and flutter to all the viewers thank you.

  • @bhaskarmahajan98
    @bhaskarmahajan98 3 ปีที่แล้ว +1

    Why did we create user_model.dart as it was not used anywhere as we directly used the UserProvider ?
    (or was there some under the hood things done by GetX to use that model which I did not get ) ?

  • @hafiztouseef6184
    @hafiztouseef6184 2 ปีที่แล้ว

    what type of pattern is it ? can we relate it wih mvvm?

  • @AkbarAli-sn8dg
    @AkbarAli-sn8dg 7 หลายเดือนก่อน

    What is the use of stateMixin🤔

  • @stackflow4007
    @stackflow4007 2 ปีที่แล้ว

    Thanks! Instead of List, Can you use List ?

    • @ripplescode
      @ripplescode  2 ปีที่แล้ว

      Go through entire playlist...I have used List as well.

  • @prakashgoswami2765
    @prakashgoswami2765 4 ปีที่แล้ว

    Wonder full explanation. Please make a video for CRUD operation using StateMixin and GetConnect.

  • @edimulyono5475
    @edimulyono5475 3 ปีที่แล้ว +1

    can modify the loading indicator??
    example i want to modify loading indicator become shimmer

    • @ripplescode
      @ripplescode  3 ปีที่แล้ว

      In the view you can use onLoading parameter to use your custom loading indicator

    • @thisaragunasekara924
      @thisaragunasekara924 3 ปีที่แล้ว

      Can you please provide a link i also trying to add loading idicator but cant
      I make true is loading in provider and try to add it to the home view class under body.obx and also above return card but not working

  • @Takemetechnically
    @Takemetechnically 3 ปีที่แล้ว

    How to use this code with multiple URL api ?

  • @DelgadoRecords
    @DelgadoRecords 4 ปีที่แล้ว

    Nice video!
    A tutorial about how to use bindings would be great

  • @edwinjacobjoy2080
    @edwinjacobjoy2080 3 ปีที่แล้ว

    have you used the model of the JSON? Connecting getconnect to model

  • @kanam8704
    @kanam8704 2 ปีที่แล้ว

    Hi there, is it possible to use Chapter 21's approach to handle this API ?

  • @Ghar_ka_khana1831
    @Ghar_ka_khana1831 2 ปีที่แล้ว

    how to send post request with GetConnect suppose like signup/register, please answer. I'm in bit of confusion.

    • @ripplescode
      @ripplescode  2 ปีที่แล้ว

      Please refer my todo app videos in GetX playlist

  • @sale7680
    @sale7680 ปีที่แล้ว

    ❤❤❤❤❤

  • @TheMRTIMBUK2
    @TheMRTIMBUK2 3 ปีที่แล้ว +1

    Sir what is purpose of making user_model.dart ?
    my app will work without it?
    Sir Please explain

    • @ripplescode
      @ripplescode  3 ปีที่แล้ว +1

      I have not used the model in the example...just discussed how to create that...but if you want to use you can

    • @TheMRTIMBUK2
      @TheMRTIMBUK2 3 ปีที่แล้ว

      @@ripplescode Sir Thank You for reply.
      Now i understand.

  • @funnyfailsvids-o2
    @funnyfailsvids-o2 3 ปีที่แล้ว

    What about a custom class rather than list dynamic

  • @TipsUNIX
    @TipsUNIX 4 ปีที่แล้ว +1

    I waiting this toturial bro. Make with mvvm architecture. Share also the source if you can. Thanks you

    • @ripplescode
      @ripplescode  4 ปีที่แล้ว +1

      Check description

    • @TipsUNIX
      @TipsUNIX 4 ปีที่แล้ว

      @@ripplescode thanks you 👍

  • @karemzky
    @karemzky 3 ปีที่แล้ว

    Wonderful, really wonderful

    • @leobudihartokusumo2049
      @leobudihartokusumo2049 3 ปีที่แล้ว

      @Zaid Bashir At the model dart file generated, you must manually change the "Class ?" into "Info ?" or "Name ?" or "Dob ?" according to the classes name created by get_cli 1.6.0 (see the below part of the model dart file).
      Somehow the get generate model can create the correct Info class, Name class, Dob class etc but can not MAP them correctly into their class definition name at the top part of the model dart file (it just simply write it as "Class ?" which mean we must look at the correct corresponding "class name" in the bottom part of the model dart file).
      Example: Change "manually by yourselves" the:
      Class? info
      Class? login;
      Class? dob;
      Class? registered;
      into
      Info? info

      Login? login;
      Dob? dob;
      Dob? registered;
      then it will work. Notice that the dob and registered json sample file have exactly the same data structure so the get_cli only make 1 new class called "Dob class" so you have to use Dob for "dob" variable and also for "registered" variable (the get_cli is smart enough not making new "Registered class" as it detect it have the same data structure as the "Dob class" it already made inside the model dart file).
      Also, add "!" (the null check) in some part of the model dart file created by get_cli (as get_cli somehow maybe not fully comply yet with the "null safety" feature of the new flutter version.
      Example: at:
      results.add(Results.fromJson(v));
      change it into
      results!.add(Results.fromJson(v));
      After doing the two things above then the model dart file will no longer produce errors.

  • @RafaelDurelli
    @RafaelDurelli 3 ปีที่แล้ว

    Nice content. Terrible android studio theme lol 😂 😂

  • @omerekelly6989
    @omerekelly6989 3 ปีที่แล้ว

    i am geting this error type string is not a subtype of type int of index

  • @Lensbreak
    @Lensbreak 4 ปีที่แล้ว

    awesome

  • @nikhilkukreja8498
    @nikhilkukreja8498 3 ปีที่แล้ว

    Can You please make a example how can i return List because i was trying but facing issues

  • @techzone2009
    @techzone2009 3 ปีที่แล้ว

    Why get cli tool generating model class without null safety ?? I have to use freeze package 🙏

    • @ripplescode
      @ripplescode  3 ปีที่แล้ว

      Yes.. there is some problem

    • @techzone2009
      @techzone2009 3 ปีที่แล้ว

      @@ripplescode can we generate freezed model class with getx cli

    • @ripplescode
      @ripplescode  3 ปีที่แล้ว

      Never tried...will give a try.

    • @techzone2009
      @techzone2009 3 ปีที่แล้ว

      @@ripplescode thanks

  • @funnyfailsvids-o2
    @funnyfailsvids-o2 3 ปีที่แล้ว

    What if I don't want to use the default progress bar

    • @ripplescode
      @ripplescode  3 ปีที่แล้ว +1

      body: controller.obx(
      (state)=>Text(state.yourField),
      onLoading: CustomLoadingIndicator(),
      onEmpty: Text('No data found'),
      onError: (error)=>Text(error),
      ),
      );

  • @ZahraAfa
    @ZahraAfa 2 ปีที่แล้ว

    you saved my life!!!

  • @kundankumar-pv9gz
    @kundankumar-pv9gz 3 ปีที่แล้ว

    Sir
    We creat api call in controller so why we need to create getx provider
    please reply me I am confused....

    • @ripplescode
      @ripplescode  3 ปีที่แล้ว

      In GetX provider we write the code to get the data from server...from controller we call the function declared in provider and use that data in our UI.

  • @karemzky
    @karemzky 3 ปีที่แล้ว

    i try to parse news api with getx like your video , i make all steps as the video but i got this error ( xml http request error )

    • @leobudihartokusumo2049
      @leobudihartokusumo2049 3 ปีที่แล้ว

      Do you also face problems when creating a model dart file using the "get generate model with..." from the command line? (that is the model dart file created is showing error here and there, this is using get_cli 1.6.0 and flutter 2.5.1)

    • @ripplescode
      @ripplescode  3 ปีที่แล้ว

      I think you are getting errors because of null safety...

  • @MoAdel92
    @MoAdel92 4 ปีที่แล้ว

    Getconnect vs dio
    Which to use?

  • @vanaybui8037
    @vanaybui8037 4 ปีที่แล้ว +1

    Good video! Can you make a video getx with flutter_downloader package?

  • @sharifrobin170
    @sharifrobin170 3 ปีที่แล้ว

    This is a very informative video, I loved it. I also practiced it. But I have a problem. What I have to do if I want to call another request and it will change the view immediately which means it will do the same thing. I tried so many ways but can't implement it. Could you please give me some instructions?
    I really need your instruction please.
    Thank you

    • @ripplescode
      @ripplescode  3 ปีที่แล้ว

      Thanks for liking the video....but I didn't get your question completely. Please refer Todo app in GetX play list...I hope you will get the answer.

    • @sharifrobin170
      @sharifrobin170 3 ปีที่แล้ว

      @@ripplescode Thank you for replaying me.
      This is my view Architecture -
      Scaffold
      |__body
      |__Column
      |__[ List of Categories Button ]
      |__[ List of Products ] N.B: parent widget controller.obx()
      Functionality -
      # At the beginning it will show some random products in the [List of products] view section.
      # When clicking a category buttoon from the list of categories button, it must show that related protects in [List of products] view section.
      It is easy without using StateMixin but iI want to do it with StateMixin because I think It follows DRY [Do not repeat yourself]. But the problem is when I click the "Categories Button" it does not reflect the UI. But in the backend, it actually fetches the data from the database.
      I am really sorry for the long explanation hopefully it makes sense to you. If it's not clear to you, could I have your email for more explanation if you want to.
      Really Getx makes my life so easy.
      Thank you again.

    • @ripplescode
      @ripplescode  3 ปีที่แล้ว

      Can you share the dummy code to ripplescode@gmail.com...instead of database just load the data from local JSON file and send it to me....in my spare time, I will surely check.

    • @sharifrobin170
      @sharifrobin170 3 ปีที่แล้ว

      @@ripplescode Thank you so much. I already send an email to you.

    • @ripplescode
      @ripplescode  3 ปีที่แล้ว +1

      I received your mail....I will definitely give a look at your project in my spare time.

  • @leobudihartokusumo2049
    @leobudihartokusumo2049 3 ปีที่แล้ว

    why my comment got deleted?

    • @ripplescode
      @ripplescode  3 ปีที่แล้ว

      For your kind information I have not deleted any comments of yours.

    • @leobudihartokusumo2049
      @leobudihartokusumo2049 3 ปีที่แล้ว

      @@ripplescode I have written like 3 comments before and it is gone... Well, I am sorry if maybe there is some misunderstanding between us. I just try to help the community here to find a fix for the tutorial that might not work with the newer flutter version.
      1 thing I want to ask is, did you have to edit manually the model dart file generated by the get generate model when making this tutorial video? or not?
      It seems the new get_cli and new flutter version if used with the same json data file will not produce the same result as in your video Sir (it will need some "manual editing" again so the model dart file result does not generate errors, and it is not just because of the null safety, it is because the get_cli get generate model can not map correctly the "class name")

  • @forktrader7870
    @forktrader7870 3 ปีที่แล้ว

    Please a make video of GetStream api with this api

  • @ains100
    @ains100 3 ปีที่แล้ว

    no entendi un pingo