Rest API Call with http and Provider in Flutter

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ก.พ. 2023
  • This video is a step by step process of how to integrate http Restful API call using http & provider.
    The Provider as a state management notify the data loaded from API and change the flutter UI based on API call result, error or exception.
    Reference of the dependencies Used:
    - http: (API for HTTP requests)
    pub.dev/packages/http
    - provider (A state management solution)
    pub.dev/packages/provider
    - flutter_spinkit ( Stylish Loading indicators)
    pub.dev/packages/flutter_spinkit
    GitHub Repository for Source Code Reference:
    github.com/jatinderji/provide...
    If you have any doubt, do comment.
    If you like this video, hit Like and Subscribe which is free of cost.
    Also, you can share this video with others.
    This will encourage me to do more videos on whatever topics you want.
    / @jatinderverma6

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

  • @avilashbhowmik3995
    @avilashbhowmik3995 7 หลายเดือนก่อน

    thanks a lot brother.

  • @Ravikumar-ke9qi
    @Ravikumar-ke9qi 9 หลายเดือนก่อน +3

    Bro. Wee need tutorial about provider with changenotifier. Why use provider. Which provider is best. Need basic to advance about provider. Need more than 1hour to clear knowledge about it. I hope you will respond me

  • @dannyquezada.4267
    @dannyquezada.4267 ปีที่แล้ว

    If you use final provider=Provider.of(context) before the Return of build, will it Update whole widget when a variable of provider change?

  • @mohdsaquib4740
    @mohdsaquib4740 4 หลายเดือนก่อน

    how to navigate in different screen if status code give 200 using provider

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

    instead of the second provider you have used inside the widget build can we use consumer widget instead????

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

      Not exactly, we need to implement in a little different way for that

  •  ปีที่แล้ว +1

    It would be nice if you add a search bar. Thanks

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

      th-cam.com/video/4Bt12U8coOA/w-d-xo.html This is for your reference

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

      th-cam.com/video/o3rI2pDc8MQ/w-d-xo.html Search Bar with Provider

    •  ปีที่แล้ว

      My english is not good, thank you for the searchbar you are awesome!

  • @karansukhani6389
    @karansukhani6389 3 หลายเดือนก่อน

    apiEndpoint in provider is showing error

  • @user-ei2xh3bx5y
    @user-ei2xh3bx5y หลายเดือนก่อน

    where is that api link?

  • @aleksandraweber4220
    @aleksandraweber4220 11 หลายเดือนก่อน

    Hi :). I have an issue and any solution, maybe you could help :). I want to display data with clicking a button, my app starts with slider screen and there is a button, in wihich supposed to be list from API, but I have an error: Failed assertion line 870 pos 12 '!debugBuildingDirtyElements': is not true. I want to start my slider screen, then click a button and display list from API. Thanks :).

    • @jatinderverma6
      @jatinderverma6  11 หลายเดือนก่อน

      share details of the code causing error

    • @aleksandraweber4220
      @aleksandraweber4220 11 หลายเดือนก่อน

      @@jatinderverma6 thank you, I've already found my own mistake.
      You're doing great job, don't stop, please :)

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

    ek full project koi real api ka use krke bnaiye sir koi ecommerce app provider k through

    • @jatinderverma6
      @jatinderverma6  11 หลายเดือนก่อน +1

      dear it will take time, as I have already list of videos to be done. I have shortage of time as my source of income is not YouYube.

    • @Wolff_ryder_vlogs
      @Wolff_ryder_vlogs 11 หลายเดือนก่อน

      @@jatinderverma6 ek issue face karra abi kya ap bata sakte hai fcm ke through notification bhejre using api and after recieving that notification it going to saved on the database sometimes its shows duplicate msg of notification in my database saved screen sometimes it works fine but this problem happens only in foreground state but when it is in background and terminate state it always shows single msg which is the true result

    • @jatinderverma6
      @jatinderverma6  11 หลายเดือนก่อน +1

      @@Wolff_ryder_vlogs need to see your code

    • @Wolff_ryder_vlogs
      @Wolff_ryder_vlogs 11 หลายเดือนก่อน +1

      @@jatinderverma6 now solved sir thanks for replying my comment.

  • @aleksandraweber4220
    @aleksandraweber4220 11 หลายเดือนก่อน

    Hi. I met another problem :). Your code is working excellent, but I can't find any solution of my next issue, hope you can help me. I display my data in list, it works great, but I need somethnig more. When I click on item in my list, it fetchs data from another endpoint and it's good, but it takes only one element, first index. I need to display every elements with particular id. My questions is: where in code I can define paramaters? Technically I can't do this in get method of http. Where I can define params and search every item with them inside?

    • @jatinderverma6
      @jatinderverma6  11 หลายเดือนก่อน

      Do pass data i.e. if from List Screen to Details Screen and then perform API call as per that ID

    • @aleksandraweber4220
      @aleksandraweber4220 11 หลายเดือนก่อน

      @@jatinderverma6 I have a list where there are various names. when I click on one of the names, I connect to another enpoint with elements containing different ids. For example: there is an employee who works several jobs. By clicking on his name, I want all the companies with his details to appear. Problem: I don't know where I can define the parameter by which the program should filter the endpoint where I search for a given employee.
      Thank you for your reply.

    • @jatinderverma6
      @jatinderverma6  11 หลายเดือนก่อน

      @@aleksandraweber4220 could you please share the endpoint if possible, so that I can take a look at response and then can guide accordingly

    • @aleksandraweber4220
      @aleksandraweber4220 11 หลายเดือนก่อน

      @@jatinderverma6 can I, please, get your email?

    • @jatinderverma6
      @jatinderverma6  11 หลายเดือนก่อน

      jatinder.verma6@gmail.com