discontinuedPackage jet_cad_floor_plan has been discontinued and replaced by jet_cad_2d_plan.

prepareDocument function

DraftDocument prepareDocument(
  1. TextMeasurer measurer
)

A fresh document over measurer with the app's set-up and nothing else (spec 12a D4): the app's component types registered, once (registerAppComponents); the header's units millimetres (the header's own default is unitless); the DASHED linetype record at handle 6, outside the history (spec 10 D3). No page, no entity, no history.

Implementation

DraftDocument prepareDocument(TextMeasurer measurer) {
  final doc = DraftDocument.empty(measurer: measurer);
  registerAppComponents(doc.components);
  doc.header.units = DrawingUnits.millimeters;
  ensureDashedLinetype(doc);
  return doc;
}