hello i try to upload image with dio package but i have to set contentType for image but i can not set it and get this error when set MediaType ====> The method 'MediaType' isn't defined for the type 'AnalyzeData'.
this is mycode
Dio dio = new Dio();
dio.options.headers = {
'token': token,
};
try {
String ip = await getServerIP();
FormData formData = new FormData.fromMap({
"front":front==null?null: MultipartFile.fromFileSync(
front,
filename: "image.png",
contentType: MediaType() <=== get error in this line
),
}
);
response = await dio.post("$url", data: formData);
how can i fix it i use last version of Dio package