ApiClient constructor

ApiClient(
  1. String baseUrl, {
  2. String? bearerToken,
})

Implementation

ApiClient(String baseUrl, {String? bearerToken}) {
  _dio = Dio(
    BaseOptions(
      baseUrl: baseUrl,
      connectTimeout: Duration(milliseconds: 5000),
      receiveTimeout: Duration(milliseconds: 3000),
    ),
  )..interceptors.add(Logging());

  if (bearerToken != null) {
    _bearerToken = "Bearer $bearerToken";
  }
}