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
+12 -1
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import '../model/device.dart';
import '../utils/friendly_date_formatter.dart';
@@ -277,6 +278,8 @@ class _DeviceListState extends State<DeviceList> {
? null
: theme.colorScheme.secondaryContainer,
child: ListTile(
onTap: () =>
context.push('/devices/${device.macAddress}'),
leading: Tooltip(
message:
device.deviceType.isEmpty ||
@@ -309,13 +312,21 @@ class _DeviceListState extends State<DeviceList> {
PopupMenuButton<String>(
icon: const Icon(Icons.more_vert),
onSelected: (value) async {
if (value == 'forget') {
if (value == 'details') {
context.push(
'/devices/${device.macAddress}',
);
} else if (value == 'forget') {
await _confirmForget(device);
} else if (value == 'register') {
await _showRegisterDialog(device);
}
},
itemBuilder: (context) => [
const PopupMenuItem(
value: 'details',
child: Text('View details'),
),
if (device.isRegistered)
const PopupMenuItem(
value: 'forget',