Notifications page
Doesn't yet allow for jumping to events
This commit is contained in:
parent
9e7fcdbef7
commit
23e01c7a0d
12 changed files with 296 additions and 139 deletions
|
|
@ -78,10 +78,12 @@ final class const RoomChat({
|
|||
final hasMore = useState<bool>(true);
|
||||
|
||||
Future<void> jumpToId(String eventId) async {
|
||||
final index = controllerData.value?.indexWhere(
|
||||
(element) => element.eventId == eventId,
|
||||
);
|
||||
if (index == null) return;
|
||||
final index =
|
||||
controllerData.value?.indexWhere(
|
||||
(element) => element.eventId == eventId,
|
||||
) ??
|
||||
-1;
|
||||
if (index == -1) return;
|
||||
|
||||
listController.value.animateToItem(
|
||||
index: index,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import "package:navigation_rail_m3e/navigation_rail_m3e.dart";
|
|||
import "package:nexus/controllers/key.dart";
|
||||
import "package:nexus/controllers/spaces.dart";
|
||||
import "package:nexus/models/room.dart";
|
||||
import "package:nexus/pages/notifications.dart";
|
||||
import "package:nexus/pages/settings.dart";
|
||||
import "package:nexus/widgets/avatar_or_hash.dart";
|
||||
import "package:nexus/widgets/divider_widget.dart";
|
||||
|
|
@ -189,6 +190,15 @@ class const Sidebar({required final bool isDesktop, super.key})
|
|||
onPressed: null,
|
||||
icon: Icon(Icons.explore),
|
||||
),
|
||||
IconButton(
|
||||
tooltip: "Open notifications",
|
||||
onPressed: () => Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => NotificationsPage(),
|
||||
),
|
||||
),
|
||||
icon: Icon(Icons.notifications),
|
||||
),
|
||||
IconButton(
|
||||
tooltip: "Open settings",
|
||||
onPressed: () => showDialog(
|
||||
|
|
|
|||
Loading…
Reference in a new issue