A flexible Dart library to parse templates and render output such as:

Features

  • Use variables and nested variables

Getting started

See: Installing

Usage

import 'package:template_engine/template_engine.dart';

void main() {
  var template = TextTemplate('Hello {{name}}.');
  // See also FileTemplate and WebTemplate
  var engine = TemplateEngine(variables: {'name': 'world'});
  var model = engine.parse(template);
  // Here you could additionally mutate or validate the model if needed.
  print(engine.render(model)); // should print 'Hello world.';
}

For more see: Examples

Libraries

template_engine