Template.fromSource constructor

Template.fromSource(
  1. String source, {
  2. bool lenient = false,
  3. bool htmlEscapeValues = true,
  4. String? name,
  5. PartialResolver? partialResolver,
  6. 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.

Implementation

Template.fromSource(String source,
    {bool lenient = false,
    bool htmlEscapeValues = true,
    String? name,
    PartialResolver? partialResolver,
    String delimiters = '{{ }}'})
    : source = source,
      _nodes = parser.parse(source, lenient, name, delimiters),
      _lenient = lenient,
      _htmlEscapeValues = htmlEscapeValues,
      _name = name,
      _partialResolver = partialResolver;