Rest API Call with http and Provider in Flutter
Vložit
- čas přidán 7. 09. 2024
- 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/packag...
- provider (A state management solution)
pub.dev/packag...
- flutter_spinkit ( Stylish Loading indicators)
pub.dev/packag...
GitHub Repository for Source Code Reference:
github.com/jat...
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
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
thanks a lot brother.
It would be nice if you add a search bar. Thanks
czcams.com/video/4Bt12U8coOA/video.html This is for your reference
czcams.com/video/o3rI2pDc8MQ/video.html Search Bar with Provider
My english is not good, thank you for the searchbar you are awesome!
how to navigate in different screen if status code give 200 using provider
instead of the second provider you have used inside the widget build can we use consumer widget instead????
Not exactly, we need to implement in a little different way for that
If you use final provider=Provider.of(context) before the Return of build, will it Update whole widget when a variable of provider change?
Nope
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 :).
share details of the code causing error
@@jatinderverma6 thank you, I've already found my own mistake.
You're doing great job, don't stop, please :)
apiEndpoint in provider is showing error
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?
Do pass data i.e. if from List Screen to Details Screen and then perform API call as per that ID
@@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.
@@aleksandraweber4220 could you please share the endpoint if possible, so that I can take a look at response and then can guide accordingly
@@jatinderverma6 can I, please, get your email?
jatinder.verma6@gmail.com
where is that api link?
ek full project koi real api ka use krke bnaiye sir koi ecommerce app provider k through
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.
@@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
@@Wolff_ryder_vlogs need to see your code
@@jatinderverma6 now solved sir thanks for replying my comment.