render method
Implementation
@override
String render(String? filename, {Map<String, dynamic>? params}) {
var filePath = join('app', 'views', filename);
var file = File(filePath);
if (file.existsSync()) {
var template = file.readAsStringSync();
params?.forEach((key, value) {
print('Replacing $key with $value');
template = template.replaceAll('{{ $key }}', value.toString());
});
print('Returning template: $template');
return template;
} else {
throw Exception('File not found: $filePath');
}
}