mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 12:59:21 +00:00
Updated Dio
This commit is contained in:
parent
13394811bb
commit
6e867041e8
@ -37,12 +37,17 @@ class APIHelper {
|
||||
else
|
||||
url = Uri.https(config().apiServerName, path);
|
||||
|
||||
final data = FormData.from(request.args);
|
||||
final data = FormData.fromMap(request.args);
|
||||
|
||||
// Process files (if required)
|
||||
if (multipart)
|
||||
request.files.forEach(
|
||||
(k, v) => data.add(k, UploadFileInfo(v, v.path.split("/").last)));
|
||||
for (var key in request.files.keys) {
|
||||
var v = request.files[key];
|
||||
data.files.add(MapEntry(
|
||||
key,
|
||||
await MultipartFile.fromFile(v.path,
|
||||
filename: v.path.split("/").last)));
|
||||
}
|
||||
|
||||
// Execute the request
|
||||
final response = await Dio().post(
|
||||
|
@ -57,13 +57,6 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
cookie_jar:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: cookie_jar
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -91,7 +84,7 @@ packages:
|
||||
name: dio
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.2"
|
||||
version: "3.0.9"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
|
@ -22,7 +22,7 @@ dependencies:
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^0.1.2
|
||||
cupertino_icons: ^0.1.3
|
||||
|
||||
# Preferences are useful for a lot of things (ex: login tokens)
|
||||
shared_preferences: ^0.5.6+3
|
||||
@ -34,7 +34,7 @@ dependencies:
|
||||
image_picker: ^0.6.3+4
|
||||
|
||||
# The HTTP client is used to make requests on the Comunic API
|
||||
dio: ^2.1.2
|
||||
dio: ^3.0.9
|
||||
|
||||
# This plugins allows to load remote images
|
||||
cached_network_image: ^2.0.0
|
||||
|
Loading…
Reference in New Issue
Block a user