authenticatedDioProvider top-level property

AutoDisposeProviderFamily<Dio, ChatwootParameters> 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, ChatwootParameters>((ref, params) {
  final authenticatedDio = Dio(BaseOptions(baseUrl: params.baseUrl));
  final interceptor = ref.read(chatwootClientApiInterceptorProvider(params));
  authenticatedDio.interceptors.add(interceptor);
  return authenticatedDio;
});