provide all tags on edit space

This commit is contained in:
hannathkadher
2025-02-03 22:23:53 +04:00
parent 72241cba6c
commit 6f51c2d2b6
5 changed files with 78 additions and 52 deletions

View File

@ -40,4 +40,22 @@ class SpaceHelper {
return "$baseName(${maxNumber + 1})";
}
static bool isSave(List<SpaceModel> spaces) {
return spaces.isNotEmpty &&
spaces.any((space) =>
space.status == SpaceStatus.newSpace ||
space.status == SpaceStatus.modified ||
space.status == SpaceStatus.deleted);
}
static bool isHighlightedSpace(SpaceModel space, SpaceModel? selectedSpace) {
if (selectedSpace == null) return true;
return space == selectedSpace ||
selectedSpace.parent?.internalId == space.internalId ||
selectedSpace.children
?.any((child) => child.internalId == space.internalId) ==
true;
}
}