BaseAPIService constructor

BaseAPIService({
  1. Dio? dio,
  2. BaseOptions? options,
  3. List<Interceptor>? interceptors,
  4. CancelToken? cancelToken,
  5. bool isLogEnabled = true,
})

Implementation

BaseAPIService({
  Dio? dio,
  BaseOptions? options,
  List<Interceptor>? interceptors,
  this.cancelToken,
  bool isLogEnabled = true,
}) {
  this.dio = dio ?? Dio(options);
  this.dio.interceptors.addAll([
    if (isLogEnabled) NetworkLogInterceptor(),
    ...?interceptors,
  ]);
}