JsonResponse constructor

JsonResponse(
  1. {Object data = const {},
  2. Map<String, HeaderValue> headers = const {},
  3. int statusCode = HttpStatus.ok}
)

Implementation

JsonResponse({
  Object data = const {},
  Map<String, HeaderValue> headers = const {},
  int statusCode = HttpStatus.ok
}) {
  this.statusCode = statusCode;
  this.headers = {}..addAll(headers);
  this.content = jsonEncode(data);
}