♻️ New tab navigation

This commit is contained in:
2025-05-19 00:55:51 +08:00
parent 911439f3af
commit b918986fc5
6 changed files with 305 additions and 139 deletions

View File

@ -115,6 +115,11 @@ class ChatListScreen extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final isWide = isWideScreen(context);
if (isWide && !isAside) {
return Container(color: Theme.of(context).scaffoldBackgroundColor);
}
final chats = ref.watch(chatroomsJoinedProvider);
final chatInvites = ref.watch(chatroomInvitesProvider);
@ -133,12 +138,6 @@ class ChatListScreen extends HookConsumerWidget {
}
}
final isWide = isWideScreen(context);
if (isWide && !isAside) {
return SizedBox.shrink();
}
return AppScaffold(
appBar: AppBar(
title: Text('chat').tr(),
@ -222,7 +221,7 @@ class ChatListScreen extends HookConsumerWidget {
room: item,
isDirect: item.type == 1,
onTap: () {
if (isWide) {
if (context.router.topRoute.name == ChatRoomRoute.name) {
context.router.replace(ChatRoomRoute(id: item.id));
} else {
context.router.push(ChatRoomRoute(id: item.id));