tx_dio_interceptor

Creator: coderz1093

Last updated:

0 purchases

tx_dio_interceptor Image
tx_dio_interceptor Images
Add to Cart

Description:

tx dio interceptor

Open pub.dev
final dio = Dio();

bool _refreshToken() {
return true;
}

void _configureDio() {
final refreshTokenInterceptor = TXRefreshTokenInterceptor(
dio: dio,
onRefreshToken: () async {
return _refreshToken();
},
shouldRefreshToken: (response) {
return response.statusCode == 401;
},
onRefreshTokenFailed: (response) async {
//refresh token failed
});

//Add interceptor
dio.interceptors.add(refreshTokenInterceptor);
}

copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.