Document.template constructor

const Document.template({
  1. String name,
  2. String attachTo,
  3. required Component child,
})

Loads an external .template.html file from the filesystem and attaches the provided child component to that template.

The name (default 'index') defines which template file to load: web/<name>.template.html. The attachTo(default 'body') defines where to attach the child component in the loaded template.

Implementation

const factory Document.template({
  String name,
  String attachTo,
  required Component child,
}) = TemplateDocument;