Template class abstract

A Template can be efficiently rendered multiple times with different values.

Constructors

Template.new(String source, {bool lenient, bool htmlEscapeValues, String name, PartialResolver? partialResolver, String delimiters})
The constructor parses the template source and throws TemplateException if the syntax of the source is invalid. Tag names may only contain characters a-z, A-Z, 0-9, underscore, and minus, unless lenient mode is specified.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
name String?
An optional name used to identify the template in error logging.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source String
The template that should be filled when calling render or renderString.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
render(Object? values, StringSink sink) → void
values can be a combination of Map, List, String. Any non-String object will be converted using toString(). Null values will cause a TemplateException, unless lenient module is enabled.
renderString(Object? values) String
values can be a combination of Map, List, String. Any non-String object will be converted using toString(). Null values will cause a TemplateException, unless lenient module is enabled.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited