feat(chat): add refresh in chats screen

This commit is contained in:
mso7nueh
2025-06-26 15:49:06 +03:00
parent 80afcd8949
commit 87bf277248

View File

@@ -67,11 +67,16 @@ class _ChatsScreenState extends State<ChatsScreen> {
),
];
},
body: switch (state.state) {
BaseState.error => DataErrorWidget(onReload: () => context.read<ChatsCubit>().getChatRooms()),
BaseState.success => _buildChatList(context, state),
_ => const Loader(),
},
body: RefreshIndicator(
child: switch (state.state) {
BaseState.error => DataErrorWidget(onReload: () => context.read<ChatsCubit>().getChatRooms()),
BaseState.success => _buildChatList(context, state),
_ => const Loader(),
},
onRefresh: () async {
await context.read<ChatsCubit>().getChatRooms();
},
),
),
);
},