Skip to content

Commit 1eb36cf

Browse files
KapdroidTusharFA
authored andcommitted
feat(blob): blobUrl support impl
Signed-off-by: Kapdroid <kapdroid@Kapdroids-MacBook-Pro.local>
1 parent 5cdc8c4 commit 1eb36cf

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

lib/src/api_service_impl.dart

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ import 'package:http_parser/http_parser.dart';
1010
import 'package:path/path.dart';
1111

1212
class ApiServiceImpl implements ApiService {
13-
ApiServiceImpl({required this.baseUrl, this.interceptors, this.apiOptions}) {
13+
ApiServiceImpl({
14+
required this.baseUrl,
15+
this.blobUrl,
16+
this.interceptors,
17+
this.apiOptions,
18+
}) {
1419
_dio = Dio()
1520
..options.contentType = Headers.jsonContentType
1621
..options.connectTimeout =
@@ -37,6 +42,7 @@ class ApiServiceImpl implements ApiService {
3742
}
3843

3944
String baseUrl;
45+
String? blobUrl;
4046
Dio? _dio;
4147
ApiOptions? apiOptions;
4248

@@ -217,6 +223,14 @@ class ApiServiceImpl implements ApiService {
217223
return baseUrl;
218224
}
219225

226+
@override
227+
void setBlobUrl(String blobUrl) {
228+
this.blobUrl = blobUrl;
229+
}
230+
231+
@override
232+
String getBlobUrl(String path) => '$blobUrl$path';
233+
220234
@override
221235
String getFileUploadUrl() {
222236
return '${baseUrl}upload';

lib/src/base/api_service.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ abstract class ApiService {
6060

6161
String getBaseUrl();
6262

63+
void setBlobUrl(String blobUrl);
64+
65+
String getBlobUrl(String path);
66+
6367
String getFileUploadUrl();
6468

6569
Dio? getDioFile();

0 commit comments

Comments
 (0)