mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 08:18:55 +03:30
Fix upload image file bug
This commit is contained in:
@@ -108,7 +108,7 @@ class ItemProvider extends ChangeNotifier {
|
||||
}
|
||||
|
||||
Future<String> addImage(String batchId, dynamic file, String fileName) async {
|
||||
var imageListInt = file.cast<int>();
|
||||
Uint8List imageListInt = Uint8List.fromList(file.cast<int>());
|
||||
var dio = new Dio();
|
||||
dio.options.headers = {
|
||||
'Authorization': User.token,
|
||||
@@ -121,15 +121,10 @@ class ItemProvider extends ChangeNotifier {
|
||||
"file": MultipartFile.fromBytes(imageListInt, filename: fileName)
|
||||
},
|
||||
);
|
||||
|
||||
await dio.post(
|
||||
Url.addImage,
|
||||
data: formData,
|
||||
);
|
||||
// print(response.statusCode);
|
||||
// print(response.statusMessage);
|
||||
// print(response.data);
|
||||
|
||||
return 'Added';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user