jsonResponse function

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

Create a JSON response

Implementation

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