From d72fe0d06031c31ca5371f3ea852723c9d876bce Mon Sep 17 00:00:00 2001 From: Bruno D'Luka Date: Sat, 16 Dec 2023 15:26:35 -0300 Subject: [PATCH] fix: devices equality --- lib/models/device.dart | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/lib/models/device.dart b/lib/models/device.dart index c29d0d57..c5100fb5 100644 --- a/lib/models/device.dart +++ b/lib/models/device.dart @@ -293,22 +293,23 @@ class Device { 'Device($name, $uri, online: $status, ${resolutionX}x$resolutionY, ptz: $hasPTZ)'; @override - bool operator ==(Object other) { + bool operator ==(covariant Device other) { if (identical(this, other)) return true; - - return other is Device && - other.name == name && - other.id == id && - other.status == status && - other.resolutionX == resolutionX && - other.resolutionY == resolutionY && - other.hasPTZ == hasPTZ && - other.server == server && - other.url == url && - other.matrixType == matrixType && - listEquals(other.overlays, overlays) && - other.preferredStreamingType == preferredStreamingType && - other.externalData == externalData; + return uuid == other.uuid; + + // return other is Device && + // other.name == name && + // other.id == id && + // other.status == status && + // other.resolutionX == resolutionX && + // other.resolutionY == resolutionY && + // other.hasPTZ == hasPTZ && + // other.server == server && + // other.url == url && + // other.matrixType == matrixType && + // listEquals(other.overlays, overlays) && + // other.preferredStreamingType == preferredStreamingType && + // other.externalData == externalData; } @override