below is the code that I tried but it didn't work, how to insert header on MultipartRequest?
var id = prefs.getInt('id');
var token = prefs.getString('accessToken');
var uri = Uri.parse('https://url.com/submit/$id');
var headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer $token'
};
var request = http.MultipartRequest('POST', uri);
request.files.add(
await http.MultipartFile.fromPath('file', _files.first.path.toString()),
);
var response = await request.send();