authenticatedDioProvider top-level property

AutoDisposeProviderFamily<Dio, DOOParameters> authenticatedDioProvider
final

Provides an instance of Dio with interceptors set to authenticate all requests called with this dio instance

Implementation

final authenticatedDioProvider =
    Provider.family.autoDispose<Dio, DOOParameters>((ref, params) {
  final authenticatedDio = Dio(BaseOptions(baseUrl: params.baseUrl));
  final interceptor = ref.read(dooClientApiInterceptorProvider(params));
  authenticatedDio.interceptors.add(interceptor);
  return authenticatedDio;
});