render method
Renders a view to the response stream, and closes the response.
Implementation
Future<void> render(String view, [Map<String, dynamic>? data]) {
if (!isOpen) throw closed();
contentType = MediaType('text', 'html', {'charset': 'utf-8'});
return Future<String>.sync(() => app!.viewGenerator!(
view,
Map<String, dynamic>.from(renderParams)
..addAll(data ?? <String, dynamic>{}))).then((content) {
write(content);
return close();
});
}