mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Add an mDNS Scanner status card to the Status screen mirroring the ARP card, and replace the ARP card on the Home screen with a combined Status card that summarizes both scanners in one line each. Extract the shared duration formatting helper into utils/duration_formatter.dart. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
24 lines
718 B
Dart
24 lines
718 B
Dart
class MdnsScannerStatus {
|
|
final bool isListening;
|
|
final double? listeningForSeconds;
|
|
final int devicesSeen;
|
|
final double? lastDeviceSeenSecondsAgo;
|
|
|
|
const MdnsScannerStatus({
|
|
required this.isListening,
|
|
this.listeningForSeconds,
|
|
required this.devicesSeen,
|
|
this.lastDeviceSeenSecondsAgo,
|
|
});
|
|
|
|
factory MdnsScannerStatus.fromJson(Map<String, dynamic> json) {
|
|
return MdnsScannerStatus(
|
|
isListening: json['is_listening'] as bool,
|
|
listeningForSeconds: (json['listening_for_seconds'] as num?)?.toDouble(),
|
|
devicesSeen: (json['devices_seen'] as num).toInt(),
|
|
lastDeviceSeenSecondsAgo: (json['last_device_seen_seconds_ago'] as num?)
|
|
?.toDouble(),
|
|
);
|
|
}
|
|
}
|