Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion lib/src/api_service_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ import 'package:http_parser/http_parser.dart';
import 'package:path/path.dart';

class ApiServiceImpl implements ApiService {
ApiServiceImpl({required this.baseUrl, this.interceptors, this.apiOptions}) {
ApiServiceImpl({
required this.baseUrl,
this.blobUrl,
this.interceptors,
this.apiOptions,
}) {
_dio = Dio()
..options.contentType = Headers.jsonContentType
..options.connectTimeout =
Expand All @@ -37,6 +42,7 @@ class ApiServiceImpl implements ApiService {
}

String baseUrl;
String? blobUrl;
Dio? _dio;
ApiOptions? apiOptions;

Expand Down Expand Up @@ -217,6 +223,14 @@ class ApiServiceImpl implements ApiService {
return baseUrl;
}

@override
void setBlobUrl(String blobUrl) {
this.blobUrl = blobUrl;
}

@override
String getBlobUrl(String path) => '$blobUrl$path';

@override
String getFileUploadUrl() {
return '${baseUrl}upload';
Expand Down
4 changes: 4 additions & 0 deletions lib/src/base/api_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ abstract class ApiService {

String getBaseUrl();

void setBlobUrl(String blobUrl);

String getBlobUrl(String path);

String getFileUploadUrl();

Dio? getDioFile();
Expand Down
Loading