template_engine 0.0.2 template_engine: ^0.0.2 copied to clipboard
A Dart package to parse and render templates, using (nested) variables and custom tags.
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