simplified code across the app and consolidated duplicated helpers
This commit is contained in:
@@ -16,6 +16,7 @@ import '../../../../widget/large_profile_picture_view.dart';
|
||||
import '../../../../widget/user_avatar.dart';
|
||||
import '../talk_navigator.dart';
|
||||
import '../widgets/notification_level_sheet.dart';
|
||||
import '../widgets/room_actions.dart';
|
||||
import 'participants_list_view.dart';
|
||||
import 'shared_items_view.dart';
|
||||
|
||||
@@ -82,19 +83,8 @@ class _ChatInfoState extends State<ChatInfo> {
|
||||
}
|
||||
|
||||
Future<void> _confirmLeave() async {
|
||||
final closed = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (_) => ConfirmDialog(
|
||||
title: 'Talk-Chat verlassen',
|
||||
content: 'Du benötigst ggf. eine Einladung um erneut beizutreten.',
|
||||
confirmButton: 'Verlassen',
|
||||
onConfirmAsync: () async {
|
||||
await LeaveRoom(widget.room.token).run();
|
||||
if (mounted) _refreshList();
|
||||
},
|
||||
),
|
||||
);
|
||||
if (closed == true && mounted) Navigator.of(context).pop();
|
||||
final left = await confirmLeaveRoom(context, widget.room.token);
|
||||
if (left && mounted) Navigator.of(context).pop();
|
||||
}
|
||||
|
||||
// Spreed's POST /room/{token}/avatar requires moderator rights and rejects
|
||||
@@ -245,18 +235,10 @@ class _ChatInfoState extends State<ChatInfo> {
|
||||
SharedItemsView(widget.room, overview: _sharesOverview),
|
||||
),
|
||||
),
|
||||
if (_isFavorite)
|
||||
AsyncListTile(
|
||||
leading: const Icon(Icons.stars_outlined),
|
||||
title: const Text('Von Favoriten entfernen'),
|
||||
onPressed: _toggleFavorite,
|
||||
)
|
||||
else
|
||||
AsyncListTile(
|
||||
leading: const Icon(Icons.star_outline),
|
||||
title: const Text('Zu Favoriten hinzufügen'),
|
||||
onPressed: _toggleFavorite,
|
||||
),
|
||||
FavoriteToggleTile(
|
||||
isFavorite: _isFavorite,
|
||||
onPressed: _toggleFavorite,
|
||||
),
|
||||
NotificationLevelTile(
|
||||
level: _notificationLevel,
|
||||
trailing: const Icon(Icons.arrow_right),
|
||||
|
||||
Reference in New Issue
Block a user