httpPostProcess method Null safety

Future<Response> httpPostProcess(
  1. String url,
  2. Map<String, dynamic> body
)

Implementation

Future<http.Response> httpPostProcess(String url, Map<String, dynamic> body)async{

  Map<String, dynamic> _nBody = {
    'username': username,
    ...body
  };

  var _res = await http.post(
    Uri.parse(url),
    body: _nBody,
    headers: {
      'Accept': 'application/json',
      'Content-Type': 'application/x-www-form-urlencoded',
      'apiKey': apiKey
    },
    encoding: Encoding.getByName('utf-8')
  );

  return _res;

}