uploadFile static method
dynamic
uploadFile(
- dynamic context,
- dynamic businessId,
- File image
)
Implementation
static uploadFile(context, businessId, File image) async {
Map<String, String> headers = {
"Accept": "application/json",
"x-api-id": "$businessId",
};
print(_uploadUrl);
var uri = Uri.parse(_uploadUrl);
var request = http.MultipartRequest("POST", uri);
request.files.add(await http.MultipartFile.fromPath('file', image.path));
request.fields['fileType'] = 'image';
request.headers.addAll(headers);
var response = await request.send();
return response;
}