class SimpleTemplate { String? tpl; SimpleTemplate({this.tpl}); String fetch(Map params) { if (tpl == null) return ""; var re = RegExp(r"{{(?[^,;:'\n]+?)}}"); return tpl!.replaceAllMapped(re, (match) { var key = match.group(1)!.trim(); if (params.containsKey(key)) { return params[key]!; } return match.group(0)!; }); } }