MapLoader class
Loads a template from a map.
It's passed a map of strings bound to template names. This loader is useful for testing.
var loader = MapLoader({'index.html': 'source here'})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasSourceAccess → bool
-
Returns
true
if this loader can provide access to the source.no setteroverride - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sources
→ Map<
String, String> -
final
Methods
-
getSource(
String path) → String -
Get template source from file.
override
-
listTemplates(
) → List< String> -
Iterates over all templates.
override
-
load(
Environment environment, String path, {Map< String, Object?> ? globals}) → Template -
Loads a template to the environment template cache.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited