render method

  1. @override
void render(
  1. Response response
)
override

Renders the JSON data to the response.

This method first sets the Content-Type header to 'application/json; charset=utf-8' by calling writeContentType. It then converts the data to a JSON string using jsonEncode and writes this JSON string to the response.

Implementation

@override
void render(Response response) {
  writeContentType(response);
  final jsonData = jsonEncode(data);
  response.write(jsonData);
}