render abstract method

Future<Result<String, DmxRefusal>> render(
  1. String template,
  2. Map<String, Object?> context, {
  3. String name = 'template',
})

template rendered against context, or a refusal explaining why not.

context is any JSON-shaped model: strings, numbers, booleans, lists, and maps. Mustache truthiness decides sections, so an empty list takes the {{^…}} branch. name names the template in diagnostics.

The result is a value, never a throw: a template that does not compile comes back as Err, ready to return as a DmxRefusal.

Implementation

Future<Result<String, DmxRefusal>> render(
  String template,
  Map<String, Object?> context, {
  String name = 'template',
});