HttpRepository constructor

HttpRepository(
  1. String basePath
)

Construct a new HttpRepository instance with baseUrl string

Each HttpRepository instance has its own dio instance, with unique baseUrl (prefix) and uses same cookies from base host

Implementation

HttpRepository(this.basePath) : super() {
  dio = Dio();

  if (serverStream != null) {
    serverSubscription = serverStream!.listen((baseUrl) {
      this.baseUrl = baseUrl;
    });
  }

  if (useInterceptor) {
    dio.interceptors.add(interceptorsWrapper);
  }
}