working jumps from notif page

Doesn't work from notif page pushed from notif controller
This commit is contained in:
Henry Hiles 2026-09-26 19:13:30 -04:00
commit c90a1c41b0
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
6 changed files with 136 additions and 57 deletions

View file

@ -1,3 +1,4 @@
import "package:flutter_hooks/flutter_hooks.dart";
import "package:material_ui/material_ui.dart";
import "package:hooks_riverpod/hooks_riverpod.dart";
import "package:nexus/controllers/init_complete.dart";
@ -7,45 +8,63 @@ import "package:nexus/widgets/sidebar.dart";
import "package:nexus/widgets/room_chat/room_chat.dart";
import "package:nexus/widgets/loading.dart";
class const ChatPage({super.key}) extends ConsumerWidget {
class const ChatPage({super.key}) extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) => LayoutBuilder(
builder: (context, constraints) {
final isDesktop = constraints.maxWidth > 650;
final showMembersByDefault = constraints.maxWidth > 1000;
final initComplete = ref.watch(InitCompleteController.provider);
final roomId = ref
.watch(KeyController.provider(KeyController.roomKey))
.requireValue;
Widget build(BuildContext context, WidgetRef ref) {
final initialHighlightedEvent = useState<String?>(null);
return SafeArea(
child: Scaffold(
appBar: initComplete ? null : Appbar(),
body: initComplete
? Row(
children: [
if (isDesktop) Sidebar(isDesktop: isDesktop),
Expanded(
child: RoomChat(
key: ValueKey(roomId),
roomId: roomId,
isDesktop: isDesktop,
showMembersByDefault: showMembersByDefault,
return LayoutBuilder(
builder: (context, constraints) {
final isDesktop = constraints.maxWidth > 650;
final showMembersByDefault = constraints.maxWidth > 1000;
final initComplete = ref.watch(InitCompleteController.provider);
final roomId = ref
.watch(KeyController.provider(KeyController.roomKey))
.requireValue;
return SafeArea(
child: Scaffold(
appBar: initComplete ? null : Appbar(),
body: initComplete
? Row(
children: [
if (isDesktop)
Sidebar(
isDesktop: isDesktop,
jumpToEvent: (eventId) =>
initialHighlightedEvent.value = eventId,
),
Expanded(
child: RoomChat(
key: ValueKey((
roomId,
initialHighlightedEvent.value,
)),
roomId: roomId,
isDesktop: isDesktop,
showMembersByDefault: showMembersByDefault,
initialHighlightedEvent:
initialHighlightedEvent.value,
),
),
],
)
: Center(
child: Column(
mainAxisSize: .min,
children: [Loading(), Text("Syncing...")],
),
],
)
: Center(
child: Column(
mainAxisSize: .min,
children: [Loading(), Text("Syncing...")],
),
),
drawer: isDesktop || !initComplete
? null
: Sidebar(isDesktop: isDesktop),
),
);
},
);
drawer: isDesktop || !initComplete
? null
: Sidebar(
isDesktop: isDesktop,
jumpToEvent: (eventId) =>
initialHighlightedEvent.value = eventId,
),
),
);
},
);
}
}