v0.0.4+1
dio_interceptors
Implements interceptors for you use on Dio package.
14Likes 1430-day downloads30Pub points
Platforms unavailable
gabuldev/dio_interceptors open-source repository details.
English project snapshot. Visit GitHub for the latest content.
A interceptors to use on Dio.
You use for mock API requests.
void main() {
Dio dio = Dio();
var mockData = {
"/test" : {
"name" : "Gabul DEV",
"site" : "https://gabul.dev"
}
};
dio.interceptors.add(InterceptorMock(mockData));
void getData() async{
var res = await dio.get("/test");
print(res.data["name"])// "Gabul DEV"
print(res.data["site"])// "https://gabul.dev");
}
getData();
}
You can use for add JWT all requests
Future<String> token() async{
//Implements your logic here
return jwt;
}
dio.interceptors.add(InterceptorToken(token: () async => await token()))
Dependency list 3 items
^4.0.0-beta2{"sdk":"flutter"}{"sdk":"flutter"}Start with your use case, compare repository activity, and check the original project before adopting it.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗