Response constructor Null safety

Response(
  1. int statusCode,
  2. Map<String, dynamic>? headers,
  3. dynamic body
)

The default constructor.

There exist convenience constructors for common response status codes and you should prefer to use those.

Implementation

Response(int this.statusCode, Map<String, dynamic>? headers, dynamic body) {
  this.body = body;
  this.headers = LinkedHashMap<String, dynamic>(
      equals: (a, b) => a.toLowerCase() == b.toLowerCase(),
      hashCode: (key) => key.toLowerCase().hashCode);
  this.headers.addAll(headers ?? {});
}