chore: Move emote settings button to chat popup menu

This commit is contained in:
Christian Kußowski 2025-09-25 14:47:42 +02:00
commit 524a63e1d6
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
4 changed files with 130 additions and 32 deletions

View file

@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:collection/collection.dart';
import 'package:go_router/go_router.dart';
import 'package:image_picker/image_picker.dart';
import 'package:matrix/matrix.dart';
@ -91,20 +90,6 @@ class ChatDetailsController extends State<ChatDetails> {
}
}
void goToEmoteSettings() async {
final room = Matrix.of(context).client.getRoomById(roomId!)!;
// okay, we need to test if there are any emote state events other than the default one
// if so, we need to be directed to a selection screen for which pack we want to look at
// otherwise, we just open the normal one.
if ((room.states['im.ponies.room_emotes'] ?? <String, Event>{})
.keys
.any((String s) => s.isNotEmpty)) {
context.push('/rooms/${room.id}/details/multiple_emotes');
} else {
context.push('/rooms/${room.id}/details/emotes');
}
}
void setAvatarAction() async {
final room = Matrix.of(context).client.getRoomById(roomId!);
final actions = [

View file

@ -258,21 +258,8 @@ class ChatDetailsView extends StatelessWidget {
),
const SizedBox(height: 16),
],
Divider(color: theme.dividerColor),
ListTile(
leading: CircleAvatar(
backgroundColor: theme.scaffoldBackgroundColor,
foregroundColor: iconColor,
child: const Icon(
Icons.insert_emoticon_outlined,
),
),
title: Text(L10n.of(context).customEmojisAndStickers),
subtitle: Text(L10n.of(context).setCustomEmotes),
onTap: controller.goToEmoteSettings,
trailing: const Icon(Icons.chevron_right_outlined),
),
if (!room.isDirectChat)
if (!room.isDirectChat) ...[
Divider(color: theme.dividerColor),
ListTile(
leading: CircleAvatar(
backgroundColor: theme.scaffoldBackgroundColor,
@ -289,7 +276,6 @@ class ChatDetailsView extends StatelessWidget {
.push('/rooms/${room.id}/details/access'),
trailing: const Icon(Icons.chevron_right_outlined),
),
if (!room.isDirectChat)
ListTile(
title: Text(L10n.of(context).chatPermissions),
subtitle: Text(
@ -306,6 +292,7 @@ class ChatDetailsView extends StatelessWidget {
onTap: () => context
.push('/rooms/${room.id}/details/permissions'),
),
],
Divider(color: theme.dividerColor),
ListTile(
title: Text(