renderView method
after this function everything will be stop and send to client
Implementation
Future<String> renderView({
required String path,
int status = 200,
bool isFile = true,
bool toData = false,
Map<String, dynamic> data = const {},
bool writeAndClose = true,
}) async {
if (isClosed) return '';
if (toData) {
return renderDataParam(status: status, data: data);
}
try {
response.statusCode = status;
response.headers.contentType = _defaultContentType;
} catch (e) {
Console.i(e);
}
var renderString = await render(path: path, isFile: isFile);
if (writeAndClose) {
await this.writeAndClose(renderString);
}
return renderString;
}