discontinuedPackage jet_cad_floor_plan has been discontinued and replaced by jet_cad_2d_plan.

commit method

bool commit(
  1. ToolContext ctx,
  2. DraftCommand build(), {
  3. Set<Capability> needs = const {Capability.geometry},
})
inherited

Ruling 05-3: the permission check runs before build, so a denied shape allocates no handle. needs is every capability the built command will need (spec 06 D13, Ruling 06-10); 05's shapes need geometry alone. Returns whether the command ran.

Implementation

bool commit(ToolContext ctx, DraftCommand Function() build,
    {Set<Capability> needs = const {Capability.geometry}}) {
  final permissions = ctx.document.commands.permissions;
  if (!needs.every(permissions.allows)) return false;
  ctx.execute(build());
  return true;
}