Add device detail screen and navigate to it from notifications and devices

- New /devices/:macAddress route showing all device fields with Register/Forget actions
- Device list items are now tappable; popup menu gains a "View details" item
- Notification list items with a linked device are tappable; popup menu gains a "View device" item
- Backend: new DB migration adds optional mac_address column to notifications
- Device-related notifications (NewDeviceFound, DeviceOnlineAfterTime, DeviceChanged) now store the triggering device's MAC address

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
rzuasti
2026-05-27 18:24:35 -04:00
co-authored by Claude Sonnet 4.6
parent 07f7d54531
commit 2da339a2b0
10 changed files with 472 additions and 15 deletions
+6 -1
View File
@@ -7,6 +7,7 @@ class Notification {
bool isNew;
NotificationType notificationType;
DateTime createdOn;
String? macAddress;
Notification({
required this.id,
@@ -15,6 +16,7 @@ class Notification {
required this.notificationType,
required this.createdOn,
this.isNew = true,
this.macAddress,
});
Notification.fromJson(Map<String, dynamic> json)
@@ -25,7 +27,8 @@ class Notification {
),
title = json['title'] as String,
body = json['body'] as String,
isNew = json['is_new'] as bool;
isNew = json['is_new'] as bool,
macAddress = json['mac_address'] as String?;
Notification copyWith({bool? isNew}) => Notification(
id: id,
@@ -34,6 +37,7 @@ class Notification {
notificationType: notificationType,
createdOn: createdOn,
isNew: isNew ?? this.isNew,
macAddress: macAddress,
);
Map<String, dynamic> toJson() => {
@@ -43,5 +47,6 @@ class Notification {
'title': title,
'body': body,
'is_new': isNew,
'mac_address': macAddress,
};
}