discontinuedPackage jet_cad_floor_plan has been discontinued and replaced by jet_cad_2d_plan.

newDocument function

DraftDocument newDocument(
  1. TextMeasurer measurer, {
  2. DecimalSeparator decimalSeparator = DecimalSeparator.point,
})

The document New and launch open (spec 12a D4): prepareDocument, then defaultPage with decimalSeparator attached through the log (spec Q0 N1), then the history cleared, so a fresh document has Undo disabled and the host's save point finds it clean.

Implementation

DraftDocument newDocument(TextMeasurer measurer,
    {DecimalSeparator decimalSeparator = DecimalSeparator.point}) {
  final doc = prepareDocument(measurer);
  doc.commands.execute(SetComponentCommand<PageComponent>(
      doc.rootHandle, defaultPage(decimalSeparator: decimalSeparator)));
  doc.commands.clearHistory();
  return doc;
}