render method
Replaces placeholders formatted as {{KEY}} with their matching values from placeholders.
Implementation
String render(String templateContent, Map<String, String> placeholders) {
try {
var result = templateContent;
placeholders.forEach((key, value) {
result = result.replaceAll('{{$key}}', value);
});
return result;
} catch (e) {
throw TemplateException('Failed to render template placeholders', e);
}
}