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 statusCode, Map<String, dynamic>? headers, dynamic body) {
  this.body = body;
  this.headers = LowercaseMap.fromMap(headers ?? {});
  this.statusCode = statusCode;
}