apply method

  1. @override
Future<List<Node>> apply(
  1. Page page,
  2. List<Node> nodes
)
override

Applies the extension to the given Page and parsed Nodes.

The page may be modified in place while the nodes should be returned as a new list.

As the page is already parsed, modifying its content or data may not have any effect. Though it can be used to provide additional context to later applied extensions or layouts.

Implementation

@override
Future<List<Node>> apply(Page page, List<Node> nodes) async {
  return [
    ComponentNode(Document.head(children: [Style(styles: _styles)])),
    for (final node in nodes) _processNode(node),
  ];
}