Simplify and modularize device, notification, and settings screens

Extract inline widget closures into named StatelessWidgets (_DeviceCard,
_DeviceFilterSheet, _NotificationCard), replace magic ints and hardcoded
repeated widgets with enum-driven loops, fix the InputDecorator/DropdownButton
hack in device_actions, merge symmetric _markAsRead/_markAsNew into _setRead,
and remove dead _isLoading/_isSaving state in settings where operations are
synchronous.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
rzuasti
2026-05-28 11:14:29 -04:00
co-authored by Claude Sonnet 4.6
parent e1287e5a0f
commit e6ec771f3b
6 changed files with 535 additions and 586 deletions
+18 -14
View File
@@ -73,21 +73,25 @@ Future<void> showRegisterDeviceDialog(
onSaved: (value) => owner = value?.trim() ?? '',
),
const SizedBox(height: 16),
InputDecorator(
DropdownButtonFormField<DeviceType>(
initialValue: deviceType,
decoration: const InputDecoration(labelText: 'Device Type'),
child: DropdownButton<DeviceType>(
value: deviceType,
isExpanded: true,
underline: const SizedBox(),
items: DeviceType.values
.map(
(t) =>
DropdownMenuItem(value: t, child: Text(t.label)),
)
.toList(),
onChanged: (value) =>
setDialogState(() => deviceType = value ?? deviceType),
),
items: DeviceType.values
.map(
(t) => DropdownMenuItem(
value: t,
child: Row(
children: [
Icon(t.icon, size: 16),
const SizedBox(width: 4),
Text(t.label),
],
),
),
)
.toList(),
onChanged: (value) =>
setDialogState(() => deviceType = value ?? deviceType),
),
],
),