title: Pass the attached form data as payload in api request in bloc pattern flutter
body: <p><a href="https://i.stack.imgur.com/rIpWa.jpg" rel="nofollow noreferrer">Fom Data Sample</a>&gt;
  I have to send the attached form data as payload in flutter block</p>
  <blockquote>
  <p>pattern.</p>
  <p>this is the bloc method for form.</p>
  <p>else if (apiType == API_TYPE.FORM) {
  MultipartRequest request = http.MultipartRequest('POST', url);
  Map&lt;String, dynamic&gt; jsonParam = jsonDecode(reqJson);
  jsonParam.forEach((k, v) {
  request.fields[k] = v;
  // The &quot;map&quot; is not adding correctly.
  });
  request.headers.addAll(headerMap);
  var responseTemp = await request.send();
  response = await http.Response.fromStream(responseTemp);
  } else {
  response = await client
  .delete(url, headers: headerMap)
  .timeout(timeoutDuration);
  }</p>
  </blockquote>
  <p>I cannot able to send the Files and map as payload. Other values are correctly done.</p>