loading state and error handling refactor

This commit is contained in:
2026-05-06 10:11:45 +02:00
parent 2c376afd91
commit 4b1d4379a0
48 changed files with 1377 additions and 354 deletions
+9 -3
View File
@@ -12,6 +12,7 @@ import '../../../state/app/modules/chatList/bloc/chat_list_state.dart';
import '../../../notification/notify_updater.dart';
import '../../../state/app/modules/settings/bloc/settings_cubit.dart';
import '../../../widget/confirm_dialog.dart';
import '../../../widget/placeholder_view.dart';
import 'widgets/chat_tile.dart';
import 'widgets/split_view_placeholder.dart';
import 'join_chat.dart';
@@ -144,9 +145,7 @@ class _ChatListViewState extends State<_ChatListView> {
title: 'Chat starten',
content: "Möchtest du einen Chat mit Nutzer '$username' starten?",
confirmButton: 'Chat starten',
onConfirm: () {
bloc.createDirectChat(username);
},
onConfirmAsync: () => bloc.createDirectChat(username),
).asDialog(context);
});
},
@@ -164,6 +163,13 @@ class _ChatListViewState extends State<_ChatListView> {
unreadToTop: talkSettings.sortUnreadToTop,
);
if (sorted.isEmpty) {
return const PlaceholderView(
icon: Icons.chat_bubble_outline,
text: 'Noch keine Chats — starte einen über das +-Symbol.',
);
}
return ListView(
padding: EdgeInsets.zero,
children: sorted.map((room) {