asnasd/lib/helpers/extensions/get_all_child_rooms.dart
2026-11-25 16:29:09 -05:00

12 lines
396 B
Dart

import "package:fast_immutable_collections/fast_immutable_collections.dart";
import "package:nexus/models/room.dart";
import "package:nexus/models/space.dart";
extension GetAllChildRooms on Space {
IList<Room> get allChildRooms => subSpaces
.map((subspace) => subspace.children)
.toIList()
.insert(childrenIndex, children)
.expand((rooms) => rooms)
.toIList();
}