TemplateEngine class
A powerful, Laravel Blade-inspired templating engine for Dart.
Supports layouts, includes, control structures, and secure interpolation.
Async Support: render() and internal processing are now asynchronous to prevent blocking the event loop on file I/O.
Constructors
- TemplateEngine({required String viewsDirectory, required String publicDirectory})
-
Creates a new template engine instance.
publicDirectorynot necessary but provided for future directives
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- publicDirectory → String
-
Public assets directory.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shouldCache ↔ bool
-
Whether to enable template caching.
getter/setter pair
- viewsDirectory → String
-
Directory containing
.htmlview templates.final
Methods
-
clearCache(
) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
render(
String templateName, [Map< String, dynamic> ? data]) → Future<String> - Renders a template with the provided data asynchronously.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited