diff --git a/lib/src/api_service_impl.dart b/lib/src/api_service_impl.dart index d51cbb1..4630528 100644 --- a/lib/src/api_service_impl.dart +++ b/lib/src/api_service_impl.dart @@ -104,13 +104,18 @@ class ApiServiceImpl implements ApiService { @override Future> postFile({ String? endpoint, + String? url, String? keyName, File? file, ProgressCallback? onSendProgress, ApiOptions? options, Map? queryParameters, }) async { - endpoint = endpoint != null ? "$baseUrl$endpoint" : getFileUploadUrl(); + // if the endpoint is not passed use url parameter + // if both of them are null then use default fileUploadUrl + + endpoint = + endpoint != null ? "$baseUrl$endpoint" : url ?? getFileUploadUrl(); if (queryParameters != null) { var queryUrl = ""; for (final parameter in queryParameters.entries) { diff --git a/lib/src/base/api_service.dart b/lib/src/base/api_service.dart index 8a2b3e0..e488ef2 100644 --- a/lib/src/base/api_service.dart +++ b/lib/src/base/api_service.dart @@ -30,12 +30,14 @@ abstract class ApiService { ApiOptions? options, }); - Future> postFile( - {String? endpoint, - String? keyName, - File? file, - ProgressCallback? onSendProgress, - Map? queryParameters}); + Future> postFile({ + String? endpoint, + String? url, + String? keyName, + File? file, + ProgressCallback? onSendProgress, + Map? queryParameters, + }); void setBaseUrl(String baseUrl);