buildPublicDio function

Dio buildPublicDio({
  1. required BaseOptions baseOptions,
  2. required NullParamsInterceptor nullParamsInterceptor,
  3. required AppExceptionMappingInterceptor exceptionMappingInterceptor,
  4. required ReportingInterceptor reportingInterceptor,
  5. required PrettyDioLogger prettyDioLogger,
  6. List<String> allowedSHA256Fingerprints = SecurityConstants.allowedSHA256Fingerprints,
})

Builds the public (unauthenticated) Dio client, for routes like login and register.

Interceptor order: null-param removal → exception mapping → retry → reporting → pretty logging (always last).

Implementation

Dio buildPublicDio({
  required BaseOptions baseOptions,
  required NullParamsInterceptor nullParamsInterceptor,
  required AppExceptionMappingInterceptor exceptionMappingInterceptor,
  required ReportingInterceptor reportingInterceptor,
  required PrettyDioLogger prettyDioLogger,
  List<String> allowedSHA256Fingerprints = SecurityConstants.allowedSHA256Fingerprints,
}) {
  return _buildDio(
    baseOptions: baseOptions,
    allowedSHA256Fingerprints: allowedSHA256Fingerprints,
    interceptors: (Dio dio) => <Interceptor>[
      nullParamsInterceptor,
      exceptionMappingInterceptor,
      _buildRetryInterceptor(dio),
      reportingInterceptor,
      prettyDioLogger,
    ],
  );
}