json function
Helper to create a JSON response
Implementation
Response json(dynamic data, {int statusCode = 200, Map<String, String>? headers}) {
return Response(
statusCode,
body: jsonEncode(data),
headers: {
'Content-Type': 'application/json',
...?headers,
},
);
}