http icon indicating copy to clipboard operation
http copied to clipboard

Using MultipartRequest with nullable fields value

Open alexiswbr opened this issue 3 years ago • 0 comments

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?>{} ?

alexiswbr avatar Aug 27 '21 09:08 alexiswbr