upload method

Future<Response> upload({
  1. required List<String> paths,
})

Implementation

Future<Response> upload({required List<String> paths}) {
  final fileMap = <String, dynamic>{};
  for (int i = 0; i < paths.length; i++) {
    fileMap['file_$i'] = MultipartFile.fromFileSync(paths[i]);
  }
  if (param is Map && param != null) {
    fileMap.addAll(param!);
  }
  var response = DioManager().dio.request(path, data: FormData.fromMap(fileMap), options: opt);
  return response.then((e) => e, onError: (e) {
    networkError(e);
  });
}