From d2d294e607509b8070817c3265839d4788b2f526 Mon Sep 17 00:00:00 2001 From: dab246 Date: Tue, 1 Oct 2024 15:30:42 +0700 Subject: [PATCH] Custom input parameters for dio post method --- lib/jmap/jmap_request.dart | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/jmap/jmap_request.dart b/lib/jmap/jmap_request.dart index 4e0b720..9cec8fd 100644 --- a/lib/jmap/jmap_request.dart +++ b/lib/jmap/jmap_request.dart @@ -21,7 +21,13 @@ class JmapRequest { RequestObject? _requestObject; RequestObject? get requestObject => _requestObject; - Future execute({CancelToken? cancelToken}) async { + Future execute({ + Map? queryParameters, + Options? options, + CancelToken? cancelToken, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { _requestObject = (RequestObject.builder() ..usings(_capabilities.asSet()) ..methodCalls(_invocations.values.toList())) @@ -30,7 +36,11 @@ class JmapRequest { return _httpClient.post( '', data: _requestObject?.toJson(), - cancelToken: cancelToken + queryParameters: queryParameters, + options: options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ) .then(extractData) .catchError((error) => throw error);