Last updated:
0 purchases
restopi
This Package is used for executing APIs in a very easy form.Handling all the status codes with a loading function built in.
Features #
Calling APIs in in a simple form.
Easy Loading built in.
Handling API error codes.
Getting started #
Set Base URL in main().
Set enableLoading true if you want to enable loading else set to false.
Restopi.baseUrl = "gorest.co.in";
Restopi.enableLoading = true;
copied to clipboard
If Enabling Loading you Need to Add Restopi().builderInit() .
MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
builder: Restopi.builderInit(),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
copied to clipboard
If Enabling Loading you can Add design to to your Loading by using:-
Restopi().restopiInitialize(
indicatorColor: Colors.black,
progressColors: Colors.black,
backgroundColor: Colors.blueAccent,
textColor: Colors.red,
maskColor: Colors.amber,
indicatorSize: 30,
radius: 20,
userInteractions: true,
dismissOnTap: false,
easyLoadingIndicatorType: EasyLoadingIndicatorType.circle,
easyLoadingStyle: EasyLoadingStyle.dark,
);
copied to clipboard
Usage #
Restopi().hitRestopi(
buildContext: context,
query: {},
body: {},
restopiMethod: RestopiMethods.post,
urlEndPoint: 'public/v2/users',
headers: {"content-language": "en"},
onFail: (value) {},
onConnectionLost: () {},
showLoading: true,
onSuccess: (value) {
});
copied to clipboard
Additional information #
Made by :- Vaibhav Chandolia
Email:- [email protected]
Website:- vaibhavchandolia.info
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.