Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
Updated 29 April 2023
Retrofit API call without Future Builder is used to call Rest API.
we can use it for sending dynamic headers, parameters, requests & responses in a more secure way.
In mobile app development connecting with the server(via API) to store or fetch the data is the most basic requirement.
So, in today’s blog, we check the Retrofit API call without Future Builder.
I hope we are all familiar with it, but we are not using Future Builder.
FutureBuilder is a widget by Flutter which lets you determine the current state of the Future.
Here we have discussed another approach of calling Rest API without Future Builder in Retrofit.
Check our Flutter app development services page.
Now, run the command “flutter pub get” to download the dependencies.
Right now, we will observe some errors in the file in part “api_client4.g.dart” and ApiClient1.
We need to run the command to generate an “api_client4.g.dar” file.
flutter pub run build_runner build
The above command will generate the api_client4.g.dart file. We should never modify the code in the api_client4.g.dart file by hand.
Therefore if we made any changes in ApiClient1. So we need to run the command to update the part file.
Please find below the complete code for main.dart class.
Finally, we can run the code and as a result, we can see the below output.
In this blog, we have discussed Retrofit API calling without using Future Builder.
I hope it will help you out in understanding and getting a brief idea about it.
Similarly, for more interesting blogs check out here – https://mobikul.com/blog/
Thank you for reading!!
https://pub.dev/packages/retrofit
https://medium.com/mindful-engineering/retrofit-the-easiest-way-to-call-rest-apis-is-flutter-fe55d1e7c5c2
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
Name
Email
Subject
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.