StreamResponse.fromFile constructor
StreamResponse.fromFile(})
Response that writes the contents of file
to the response.
Implementation
factory StreamResponse.fromFile(
File file, {
statusCode = 200,
Map<String, dynamic>? headers,
String? mimeType,
String? charset,
List<Cookie>? cookies,
}) =>
StreamResponse(
body: file.openRead(),
statusCode: statusCode,
headers: headers,
mimeType: mimeType ?? MimeTypes.ofFile(file),
charset: charset,
cookies: cookies,
);