canvases property

List<PreviewCanvas> canvases
final

What the previews under each subtree are framed as. See PreviewCanvas.

device is one of these with no prefix, which is the whole relationship between the two: a project that is all phones says device: and is done, and a package holding two form factors says where each of them lives.

PreviewsPackage(app, directory: 'demo', canvases: [
  PreviewCanvas('demo/src/mobile', devices: [Devices.iphone16]),
  PreviewCanvas('demo/src/desktop', devices: [Devices.macbookPro]),
])

Here rather than one package declaration per form factor, which is the obvious shape to reach for and the one thing that cannot work: a package's path is the identity of its entry in the report, in fw:/// addresses and in the previews compiler's own daemon address, so a second declaration of one package is not a second thing anything downstream could name. Flutterware.configure refuses it outright for that reason.

Longest prefix wins, and two canvases with the same prefix are refused — they are one rule written twice, and either resolution drops a declared answer.

Implementation

final List<PreviewCanvas> canvases;