http
http copied to clipboard
Using MultipartRequest with nullable fields value
The fields property of the MultipartRequest class is typed like so:
final fields = <String, String>{};
Which prevents to pass some null values to it:
var request = http.MultipartRequest('POST', apiUrl);
request.fields.addAll({
'id': null, // is obviously throwing an error
'comment': 'Lorem ipsum',
});
Is it really mandatory to have a map of this type or could we change the type to <String, String?>{}
?