forked from Nexus/nexus
parent
b63fcc30b7
commit
432064e111
1 changed files with 99 additions and 60 deletions
|
|
@ -3,6 +3,10 @@ import "package:nexus/models/room.dart";
|
|||
import "package:nexus/models/space.dart";
|
||||
|
||||
extension GetAllChildRooms on Space {
|
||||
IList<Room> get allChildRooms =>
|
||||
children.addAll(subSpaces.expand((s) => s.children));
|
||||
IList<Room> get allChildRooms => subSpaces
|
||||
.map((subspace) => subspace.children)
|
||||
.toIList()
|
||||
.insert(childrenIndex, children)
|
||||
.expand((rooms) => rooms)
|
||||
.toIList();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue