jsonResponse function

Response jsonResponse(
  1. Map<String, dynamic> data, {
  2. int status = 200,
})

JSON response helper

Implementation

shelf.Response jsonResponse(
  Map<String, dynamic> data, {
  int status = 200,
}) {
  return shelf.Response(
    status,
    headers: {'Content-Type': 'application/json; charset=utf-8'},
    body: jsonEncode(data),
  );
}