layerPickerBlocked function
String?
layerPickerBlocked(
- DraftDocument doc,
- Iterable<
SelectionKey> keys, [ - FloorPlanStrings strings = const FloorPlanStringsEn()
Why the picker is disabled for keys in doc, or null when it is
enabled: a permission set without Capability.components (D11), or a
plain group among the keys (D12).
In strings' language (spec 14d); English by default, the constants
above.
Implementation
String? layerPickerBlocked(DraftDocument doc, Iterable<SelectionKey> keys,
[FloorPlanStrings strings = const FloorPlanStringsEn()]) {
if (!doc.commands.permissions.allows(Capability.components)) {
return strings.readOnlyDocument;
}
for (final k in keys) {
final node = doc.tree[k.target];
if (node is GroupNode && !isParametricObject(doc, k.target)) {
return strings.plainGroupNoLayer;
}
}
return null;
}