mutateNode method

void mutateNode(
  1. BrownfieldSelection selection,
  2. void mutate(
    1. FFNode node
    )
)

Mutates the resolved FFNode directly via mutate.

This is an escape hatch for property mutations that are not yet exposed through the typed BrownfieldWidgetPatch surface. The closure runs against the live node found in the project tree at compile time, after every other queued operation in this editor has resolved its own selectors. The closure must be idempotent because it re-runs on every compilation.

Prefer update whenever the typed surface can express the change.

page.mutateNode(page.findByName('HeroCard'), (node) {
  node.props.container.clipContent = true;
});

Implementation

void mutateNode(
  BrownfieldSelection selection,
  void Function(FFNode node) mutate,
) {
  _operations.add(_MutateNodeSpec(selection: selection, mutate: mutate));
}