Showing
4 changed files
with
46 additions
and
9 deletions
1 | +## [3.21.1] | ||
2 | +- Allow null body to POST method on GetConnect | ||
3 | + | ||
1 | ## [3.21.0] - Big update | 4 | ## [3.21.0] - Big update |
2 | - This update attaches two nice features developed by (@SchabanBo): *GetPage Children* And *GetMiddleware* | 5 | - This update attaches two nice features developed by (@SchabanBo): *GetPage Children* And *GetMiddleware* |
3 | In previous versions, to create child pages, you should do something like: | 6 | In previous versions, to create child pages, you should do something like: |
@@ -22,20 +22,32 @@ abstract class GetConnectInterface with GetLifeCycleBase { | @@ -22,20 +22,32 @@ abstract class GetConnectInterface with GetLifeCycleBase { | ||
22 | Map<String, dynamic> query, | 22 | Map<String, dynamic> query, |
23 | Decoder<T> decoder, | 23 | Decoder<T> decoder, |
24 | }); | 24 | }); |
25 | + | ||
26 | + Future<Response<T>> request<T>( | ||
27 | + String url, | ||
28 | + String method, { | ||
29 | + dynamic body, | ||
30 | + String contentType, | ||
31 | + Map<String, String> headers, | ||
32 | + Map<String, dynamic> query, | ||
33 | + Decoder<T> decoder, | ||
34 | + }); | ||
25 | Future<Response<T>> post<T>( | 35 | Future<Response<T>> post<T>( |
26 | String url, | 36 | String url, |
27 | dynamic body, { | 37 | dynamic body, { |
28 | String contentType, | 38 | String contentType, |
29 | Map<String, String> headers, | 39 | Map<String, String> headers, |
30 | Map<String, dynamic> query, | 40 | Map<String, dynamic> query, |
41 | + Decoder<T> decoder, | ||
31 | }); | 42 | }); |
32 | 43 | ||
33 | Future<Response<T>> put<T>( | 44 | Future<Response<T>> put<T>( |
34 | String url, | 45 | String url, |
35 | - Map<String, dynamic> body, { | 46 | + dynamic body, { |
36 | String contentType, | 47 | String contentType, |
37 | Map<String, String> headers, | 48 | Map<String, String> headers, |
38 | Map<String, dynamic> query, | 49 | Map<String, dynamic> query, |
50 | + Decoder<T> decoder, | ||
39 | }); | 51 | }); |
40 | 52 | ||
41 | Future<Response<T>> delete<T>( | 53 | Future<Response<T>> delete<T>( |
@@ -43,6 +55,7 @@ abstract class GetConnectInterface with GetLifeCycleBase { | @@ -43,6 +55,7 @@ abstract class GetConnectInterface with GetLifeCycleBase { | ||
43 | Map<String, String> headers, | 55 | Map<String, String> headers, |
44 | String contentType, | 56 | String contentType, |
45 | Map<String, dynamic> query, | 57 | Map<String, dynamic> query, |
58 | + Decoder<T> decoder, | ||
46 | }); | 59 | }); |
47 | 60 | ||
48 | GetSocket socket(String url, {Duration ping = const Duration(seconds: 5)}); | 61 | GetSocket socket(String url, {Duration ping = const Duration(seconds: 5)}); |
@@ -118,7 +131,7 @@ class GetConnect extends GetConnectInterface { | @@ -118,7 +131,7 @@ class GetConnect extends GetConnectInterface { | ||
118 | _checkIfDisposed(); | 131 | _checkIfDisposed(); |
119 | return httpClient.post<T>( | 132 | return httpClient.post<T>( |
120 | url, | 133 | url, |
121 | - body, | 134 | + body: body, |
122 | headers: headers, | 135 | headers: headers, |
123 | contentType: contentType, | 136 | contentType: contentType, |
124 | query: query, | 137 | query: query, |
@@ -129,7 +142,28 @@ class GetConnect extends GetConnectInterface { | @@ -129,7 +142,28 @@ class GetConnect extends GetConnectInterface { | ||
129 | @override | 142 | @override |
130 | Future<Response<T>> put<T>( | 143 | Future<Response<T>> put<T>( |
131 | String url, | 144 | String url, |
132 | - Map<String, dynamic> body, { | 145 | + dynamic body, { |
146 | + String contentType, | ||
147 | + Map<String, String> headers, | ||
148 | + Map<String, dynamic> query, | ||
149 | + Decoder<T> decoder, | ||
150 | + }) { | ||
151 | + _checkIfDisposed(); | ||
152 | + return httpClient.put( | ||
153 | + url, | ||
154 | + body: body, | ||
155 | + headers: headers, | ||
156 | + contentType: contentType, | ||
157 | + query: query, | ||
158 | + decoder: decoder, | ||
159 | + ); | ||
160 | + } | ||
161 | + | ||
162 | + @override | ||
163 | + Future<Response<T>> request<T>( | ||
164 | + String url, | ||
165 | + String method, { | ||
166 | + dynamic body, | ||
133 | String contentType, | 167 | String contentType, |
134 | Map<String, String> headers, | 168 | Map<String, String> headers, |
135 | Map<String, dynamic> query, | 169 | Map<String, dynamic> query, |
@@ -138,7 +172,7 @@ class GetConnect extends GetConnectInterface { | @@ -138,7 +172,7 @@ class GetConnect extends GetConnectInterface { | ||
138 | _checkIfDisposed(); | 172 | _checkIfDisposed(); |
139 | return httpClient.put( | 173 | return httpClient.put( |
140 | url, | 174 | url, |
141 | - body, | 175 | + body: body, |
142 | headers: headers, | 176 | headers: headers, |
143 | contentType: contentType, | 177 | contentType: contentType, |
144 | query: query, | 178 | query: query, |
@@ -275,8 +275,8 @@ class GetHttpClient { | @@ -275,8 +275,8 @@ class GetHttpClient { | ||
275 | } | 275 | } |
276 | 276 | ||
277 | Future<Response<T>> post<T>( | 277 | Future<Response<T>> post<T>( |
278 | - String url, | ||
279 | - dynamic body, { | 278 | + String url, { |
279 | + dynamic body, | ||
280 | String contentType, | 280 | String contentType, |
281 | Map<String, String> headers, | 281 | Map<String, String> headers, |
282 | Map<String, dynamic> query, | 282 | Map<String, dynamic> query, |
@@ -345,8 +345,8 @@ class GetHttpClient { | @@ -345,8 +345,8 @@ class GetHttpClient { | ||
345 | } | 345 | } |
346 | 346 | ||
347 | Future<Response<T>> put<T>( | 347 | Future<Response<T>> put<T>( |
348 | - String url, | ||
349 | - Map<String, dynamic> body, { | 348 | + String url, { |
349 | + dynamic body, | ||
350 | String contentType, | 350 | String contentType, |
351 | Map<String, String> headers, | 351 | Map<String, String> headers, |
352 | Map<String, dynamic> query, | 352 | Map<String, dynamic> query, |
1 | name: get | 1 | name: get |
2 | description: Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with GetX. | 2 | description: Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with GetX. |
3 | -version: 3.21.0 | 3 | +version: 3.21.1 |
4 | homepage: https://github.com/jonataslaw/getx | 4 | homepage: https://github.com/jonataslaw/getx |
5 | 5 | ||
6 | environment: | 6 | environment: |
-
Please register or login to post a comment