FileSystemLoader constructor

FileSystemLoader({
  1. List<String> paths = const <String>['templates'],
  2. bool recursive = true,
  3. bool followLinks = true,
  4. Set<String> extensions = const <String>{'html'},
  5. Encoding encoding = utf8,
})

Loads templates from the file system.

This loader can find templates in folders on the file system and is the preferred way to load them:

var loader = FileSystemLoader(
  path: 'templates',
  extensions: ['html', 'xml'],
);

or:

var loader = FileSystemLoader(
  paths: ['overrides/templates', 'default/templates'],
  extensions: ['html', 'xml'],
);

To follow symbolic links, set the followLinks parameter to true:

var loader = FileSystemLoader(path: 'path', followLinks: true);

Implementation

FileSystemLoader({
  List<String> paths = const <String>['templates'],
  this.recursive = true,
  this.followLinks = true,
  this.extensions = const <String>{'html'},
  this.encoding = utf8,
}) : paths = paths.map<String>(normalize).toList();