mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Extract DeviceType as an enum with icon and label getters
Mirrors the NotificationType pattern. Removes duplicated _deviceTypes list and _deviceIcon() helper from both device screens, centralising all type-to-icon logic in the model. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
2da339a2b0
commit
1b470fc28f
@@ -1,3 +1,5 @@
|
||||
import 'device_type.dart';
|
||||
|
||||
class Device {
|
||||
final String macAddress;
|
||||
final String ipv4Address;
|
||||
@@ -5,7 +7,7 @@ class Device {
|
||||
final DateTime lastSeen;
|
||||
final bool isRegistered;
|
||||
final String owner;
|
||||
final String deviceType;
|
||||
final DeviceType deviceType;
|
||||
|
||||
Device({
|
||||
required this.macAddress,
|
||||
@@ -24,5 +26,5 @@ class Device {
|
||||
lastSeen = DateTime.parse(json['last_seen'] as String),
|
||||
isRegistered = json['is_registered'] as bool,
|
||||
owner = json['owner'] as String,
|
||||
deviceType = json['device_type'] as String;
|
||||
deviceType = DeviceType.fromString(json['device_type'] as String);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user