1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-10-22 22:43:22 +00:00

Updated Dio

This commit is contained in:
Pierre HUBERT 2020-03-24 15:01:34 +01:00
parent 13394811bb
commit 6e867041e8
3 changed files with 11 additions and 13 deletions

View File

@ -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(

View File

@ -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

View File

@ -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