|
|
|
|
@ -415,7 +415,7 @@ class ApiManager {
|
|
|
|
|
return response;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<http.Response> multiPart(String url, {Map<String, String>? headers, required Map<String, String> body, required List<Future<MultipartFile>> files}) async {
|
|
|
|
|
Future<http.Response> multiPart(String url, {Map<String, String>? headers, required Map<String, String> body, bool showToast=true, required List<Future<MultipartFile>> files}) async {
|
|
|
|
|
Map<String, String> headers0 = _headers;
|
|
|
|
|
|
|
|
|
|
headers0["Content-Type"] = 'multipart/form-data';
|
|
|
|
|
@ -449,7 +449,7 @@ class ApiManager {
|
|
|
|
|
final responseBody = jsonDecode(response.body);
|
|
|
|
|
if (responseBody is Map<String, dynamic>) {
|
|
|
|
|
final message = responseBody["message"]; // Reuse parsed body
|
|
|
|
|
if (message != null && message.toString().isNotEmpty) {
|
|
|
|
|
if (message != null && message.toString().isNotEmpty&&showToast) {
|
|
|
|
|
Fluttertoast.showToast(msg: message, toastLength: Toast.LENGTH_LONG);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|