This is my payload:
final Map<String, dynamic> registration = {
'company_name': _companyName,
'team_name': _teamName,
'image': _image
};
company_name
and team_name
are string as expected. However, _image
is defined like below:
File _image;
So when I do the post request I am getting the below error on terminal:
type '_File' is not a subtype of type 'String' in type cast
I know this is happening because I defined registration
as <String, dynamic>
. How to fix this?