mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 13:05:11 +00:00
chore: Follow up add chat subspace button
This commit is contained in:
parent
fd513a355f
commit
4b69b8e5e9
1 changed files with 19 additions and 9 deletions
|
@ -264,6 +264,11 @@ class _SpaceViewState extends State<SpaceView> {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final client = Matrix.of(context).client;
|
final client = Matrix.of(context).client;
|
||||||
final activeSpaceId = widget.controller.activeSpaceId;
|
final activeSpaceId = widget.controller.activeSpaceId;
|
||||||
|
final activeSpace = activeSpaceId == null
|
||||||
|
? null
|
||||||
|
: client.getRoomById(
|
||||||
|
activeSpaceId,
|
||||||
|
);
|
||||||
final allSpaces = client.rooms.where((room) => room.isSpace);
|
final allSpaces = client.rooms.where((room) => room.isSpace);
|
||||||
if (activeSpaceId == null) {
|
if (activeSpaceId == null) {
|
||||||
final rootSpaces = allSpaces
|
final rootSpaces = allSpaces
|
||||||
|
@ -446,17 +451,22 @@ class _SpaceViewState extends State<SpaceView> {
|
||||||
),
|
),
|
||||||
onTap: () => _onJoinSpaceChild(spaceChild),
|
onTap: () => _onJoinSpaceChild(spaceChild),
|
||||||
),
|
),
|
||||||
Material(
|
if (activeSpace?.canChangeStateEvent(
|
||||||
child: ListTile(
|
EventTypes.spaceChild,
|
||||||
leading: const CircleAvatar(
|
) ==
|
||||||
child: Icon(Icons.group_add_outlined),
|
true)
|
||||||
|
Material(
|
||||||
|
child: ListTile(
|
||||||
|
leading: const CircleAvatar(
|
||||||
|
child: Icon(Icons.group_add_outlined),
|
||||||
|
),
|
||||||
|
title:
|
||||||
|
Text(L10n.of(context)!.addChatOrSubSpace),
|
||||||
|
trailing:
|
||||||
|
const Icon(Icons.chevron_right_outlined),
|
||||||
|
onTap: _addChatOrSubSpace,
|
||||||
),
|
),
|
||||||
title: Text(L10n.of(context)!.addChatOrSubSpace),
|
|
||||||
trailing:
|
|
||||||
const Icon(Icons.chevron_right_outlined),
|
|
||||||
onTap: _addChatOrSubSpace,
|
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue