Consolidate frontend scanner, pagination, and tick-timer duplication

Collapse the five scanner status models into two shared shapes,
ActiveScannerStatus and PassiveScannerStatus, mirroring the backend's
active/passive vocabulary. Replace the five near-identical per-scanner
detail card files with a single scanner_status_cards.dart (two shared
resolvers plus a config list), and rebuild the combined home card to
iterate a list of scanners with two shape resolvers instead of five
copy-pasted resolve methods.

Extract two reusable mixins:
- PeriodicRebuild: the shared once-a-second "rebuild to refresh elapsed
  text" timer used by the scanner cards and the stale indicator.
- PaginatedListState: the shared pagination state, page-size/page-count
  getters, cancel-token-aware fetch orchestration, and disposal used by
  the device and notification lists.

No behaviour change; ~900 lines removed. Tests and analyzer pass.
This commit is contained in:
rzuasti
2026-06-05 21:57:58 -04:00
parent 6b044a6739
commit 48d73fb207
22 changed files with 533 additions and 859 deletions
+2 -5
View File
@@ -8,11 +8,8 @@ import 'api/api_error.dart';
import 'api/dio_config.dart';
import 'backend_reachability.dart';
import 'pref_utils.dart';
import '../model/arp_scanner_status.dart';
import '../model/dhcp_scanner_status.dart';
import '../model/mdns_scanner_status.dart';
import '../model/ssdp_scanner_status.dart';
import '../model/snmp_scanner_status.dart';
import '../model/active_scanner_status.dart';
import '../model/passive_scanner_status.dart';
import '../model/device.dart';
import '../model/device_event.dart';
import '../model/device_summary.dart';