buildPublicDio function
- required BaseOptions baseOptions,
- required NullParamsInterceptor nullParamsInterceptor,
- required AppExceptionMappingInterceptor exceptionMappingInterceptor,
- required ReportingInterceptor reportingInterceptor,
- required PrettyDioLogger prettyDioLogger,
- 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,
],
);
}