Template class base
The base Template
class.
Constructors
-
Template(String source, {Environment? environment, String? path, String blockStart = '{%', String blockEnd = '%}', String variableStatr = '{{', String variableEnd = '}}', String commentStart = '{#', String commentEnd = '#}', String? lineCommentPrefix, String? lineStatementPrefix, bool trimBlocks = false, bool leftStripBlocks = false, String newLine = '\n', bool keepTrailingNewLine = false, bool optimize = true, ContextFinalizer finalize = defaults.finalize, bool autoEscape = false, Map<
String, Object?> ? globals, Map<String, Function> ? filters, Map<String, Function> ? tests, List<Node Function(Node)> ? modifiers, Random? random, AttributeGetter? getAttribute, ItemGetter getItem = defaults.getItem}) -
The base
Template
class.factory -
Template.fromNode(Environment environment, {String? path, Map<
String, Object?> globals = const <String, Object?>{}, required Node body}) - This is used internally by the Environment.fromString to create templates from parsed sources.
Properties
- body → Node
-
Template body node.
final
- environment → Environment
-
The environment used to parse and render template.
final
-
globals
→ Map<
String, Object?> -
The global variables for this template.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- path → String?
-
The path to the template if it was loaded.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
render(
[Map< String, Object?> ? data]) → String - If no arguments are given the context will be empty.
-
renderTo(
StringSink sink, [Map< String, Object?> ? data]) → void - If no arguments are given the context will be empty.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited