Response.fromString constructor
Creates a new Response from string value.
Implementation
factory Response.fromString(
String body, {
int status = 200,
Headers? headers,
}) {
final bytes = utf8.encode(body);
return Response(Stream.value(bytes), status: status, headers: headers)
..headers.set('Content-Type', 'text/plain')
..headers.set('Content-Length', bytes.lengthInBytes.toString());
}