|
|
@ -165,7 +165,10 @@ class _SpaceViewState extends State<SpaceView> {
|
|
|
|
final room = Matrix.of(context).client.getRoomById(widget.spaceId);
|
|
|
|
final room = Matrix.of(context).client.getRoomById(widget.spaceId);
|
|
|
|
final displayname =
|
|
|
|
final displayname =
|
|
|
|
room?.getLocalizedDisplayname() ?? L10n.of(context)!.nothingFound;
|
|
|
|
room?.getLocalizedDisplayname() ?? L10n.of(context)!.nothingFound;
|
|
|
|
return Scaffold(
|
|
|
|
return PopScope(
|
|
|
|
|
|
|
|
canPop: false,
|
|
|
|
|
|
|
|
onPopInvoked: (_) => widget.onBack(),
|
|
|
|
|
|
|
|
child: Scaffold(
|
|
|
|
appBar: AppBar(
|
|
|
|
appBar: AppBar(
|
|
|
|
leading: Center(
|
|
|
|
leading: Center(
|
|
|
|
child: CloseButton(
|
|
|
|
child: CloseButton(
|
|
|
@ -249,25 +252,14 @@ class _SpaceViewState extends State<SpaceView> {
|
|
|
|
.where((s) => s.hasRoomUpdate)
|
|
|
|
.where((s) => s.hasRoomUpdate)
|
|
|
|
.rateLimit(const Duration(seconds: 1)),
|
|
|
|
.rateLimit(const Duration(seconds: 1)),
|
|
|
|
builder: (context, snapshot) {
|
|
|
|
builder: (context, snapshot) {
|
|
|
|
final joinedRooms = room.spaceChildren
|
|
|
|
final childrenIds = room.spaceChildren
|
|
|
|
.map((child) {
|
|
|
|
.map((c) => c.roomId)
|
|
|
|
final roomId = child.roomId;
|
|
|
|
.whereType<String>()
|
|
|
|
if (roomId == null) return null;
|
|
|
|
.toSet();
|
|
|
|
return room.client.getRoomById(roomId);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.whereType<Room>()
|
|
|
|
|
|
|
|
.where((room) => room.membership != Membership.leave)
|
|
|
|
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Sort rooms by last activity
|
|
|
|
final joinedRooms = room.client.rooms
|
|
|
|
joinedRooms.sort(
|
|
|
|
.where((room) => childrenIds.remove(room.id))
|
|
|
|
(b, a) => (a.lastEvent?.originServerTs ??
|
|
|
|
.toList();
|
|
|
|
DateTime.fromMillisecondsSinceEpoch(0))
|
|
|
|
|
|
|
|
.compareTo(
|
|
|
|
|
|
|
|
b.lastEvent?.originServerTs ??
|
|
|
|
|
|
|
|
DateTime.fromMillisecondsSinceEpoch(0),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final joinedParents = room.spaceParents
|
|
|
|
final joinedParents = room.spaceParents
|
|
|
|
.map((parent) {
|
|
|
|
.map((parent) {
|
|
|
@ -291,8 +283,9 @@ class _SpaceViewState extends State<SpaceView> {
|
|
|
|
onChanged: (_) => setState(() {}),
|
|
|
|
onChanged: (_) => setState(() {}),
|
|
|
|
textInputAction: TextInputAction.search,
|
|
|
|
textInputAction: TextInputAction.search,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
decoration: InputDecoration(
|
|
|
|
fillColor:
|
|
|
|
fillColor: Theme.of(context)
|
|
|
|
Theme.of(context).colorScheme.secondaryContainer,
|
|
|
|
.colorScheme
|
|
|
|
|
|
|
|
.secondaryContainer,
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide.none,
|
|
|
|
borderSide: BorderSide.none,
|
|
|
|
borderRadius: BorderRadius.circular(99),
|
|
|
|
borderRadius: BorderRadius.circular(99),
|
|
|
@ -455,7 +448,9 @@ class _SpaceViewState extends State<SpaceView> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(width: 8),
|
|
|
|
const SizedBox(width: 8),
|
|
|
|
const Icon(Icons.add_circle_outline_outlined),
|
|
|
|
const Icon(
|
|
|
|
|
|
|
|
Icons.add_circle_outline_outlined,
|
|
|
|
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
subtitle: Text(
|
|
|
|
subtitle: Text(
|
|
|
@ -475,6 +470,7 @@ class _SpaceViewState extends State<SpaceView> {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|