Skip to content

Commit

Permalink
[postfile] add url parameter in postfile
Browse files Browse the repository at this point in the history
Signed-off-by: Ritesh Khadse <[email protected]>
  • Loading branch information
Ritsz123 committed Jan 25, 2024
1 parent 071fc11 commit 4c363a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 3 additions & 1 deletion lib/src/api_service_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,15 @@ class ApiServiceImpl implements ApiService {
@override
Future<Response<T>> postFile<T>({
String? endpoint,
String? url,
String? keyName,
File? file,
ProgressCallback? onSendProgress,
ApiOptions? options,
Map<String, dynamic>? queryParameters,
}) async {
endpoint = endpoint != null ? "$baseUrl$endpoint" : getFileUploadUrl();
endpoint =
endpoint != null ? "$baseUrl$endpoint" : url ?? getFileUploadUrl();
if (queryParameters != null) {
var queryUrl = "";
for (final parameter in queryParameters.entries) {
Expand Down
14 changes: 8 additions & 6 deletions lib/src/base/api_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ abstract class ApiService {
ApiOptions? options,
});

Future<Response<T>> postFile<T>(
{String? endpoint,
String? keyName,
File? file,
ProgressCallback? onSendProgress,
Map<String, dynamic>? queryParameters});
Future<Response<T>> postFile<T>({
String? endpoint,
String? url,
String? keyName,
File? file,
ProgressCallback? onSendProgress,
Map<String, dynamic>? queryParameters,
});

void setBaseUrl(String baseUrl);

Expand Down

0 comments on commit 4c363a7

Please sign in to comment.