render method

Future<String> render(
  1. String templateName, [
  2. Map<String, dynamic>? data
])

Loads and renders the template identified by templateName.

Values in data are available to expressions by key. Throws TemplateEngineException if the template cannot be found or parsed.

Implementation

Future<String> render(
    String templateName, [
      Map<String, dynamic>? data,
    ]) async {
  final ast = await _loadAst(templateName);
  return _renderTemplate(ast, data ?? {});
}