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 {},
}) async {
if (isClosed) return '';
if (toData) {
return renderDataParam(status: status, data: data);
}
try {
response.statusCode = status;
response.headers.contentType = ContentType.html;
} catch (e) {
Console.i(e);
}
var renderString = await render(path: path, isFile: isFile);
await writeAndClose(renderString);
return renderString;
}