mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
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:
co-authored by
Claude Sonnet 4.6
parent
e1287e5a0f
commit
e6ec771f3b
@@ -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),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user