Trellis class final

Core template engine. Parses HTML, processes tl:* attributes, renders output.

Constructors

Trellis({TemplateLoader? loader, bool cache = true, String prefix = 'tl', int maxCacheSize = 256, bool strict = false, Map<String, Function>? filters, List<Processor>? processors, List<Dialect>? dialects, bool includeStandard = true, MessageSource? messageSource, String? locale, bool devMode = false})

Properties

cache bool
final
cacheStats CacheStats
Current cache statistics snapshot.
no setter
devMode bool
final
dialects List<Dialect>?
final
filters Map<String, Function>
final
hashCode int
The hash code for this object.
no setterinherited
includeStandard bool
final
loader TemplateLoader
final
locale String?
final
maxCacheSize int
final
messageSource MessageSource?
final
prefix String
final
processors List<Processor>?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
separator String
Separator between prefix and attribute name. Derived from prefix: - if prefix contains a hyphen, : otherwise.
latefinal
strict bool
final

Methods

clearCache() → void
Clear the template cache and reset statistics.
close() Future<void>
Release resources held by this engine instance.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
render(String source, Map<String, dynamic> context) String
Render a template string with the given context.
renderFile(String name, Map<String, dynamic> context) Future<String>
Render a template file by name.
renderFileFragment(String name, {required String fragment, required Map<String, dynamic> context}) Future<String>
Render a specific named fragment from a template file.
renderFileFragments(String name, {required List<String> fragments, required Map<String, dynamic> context}) Future<String>
Render multiple named fragments from a template file, concatenated in order.
renderFragment(String source, {required String fragment, required Map<String, dynamic> context}) String
Render a specific named fragment from a template string.
renderFragments(String source, {required List<String> fragments, required Map<String, dynamic> context}) String
Render multiple named fragments from a template string, concatenated in order.
toString() String
A string representation of this object.
inherited
warmUp(List<String> names) Future<WarmUpResult>
Pre-load specific templates into the DOM cache.
warmUpAll() Future<WarmUpResult>
Discover templates from the configured loader and warm them into the DOM cache.

Operators

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