Skip to content

Commit

Permalink
fix: devices equality
Browse files Browse the repository at this point in the history
  • Loading branch information
bdlukaa committed Dec 16, 2023
1 parent ff06ede commit d72fe0d
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions lib/models/device.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d72fe0d

Please sign in to comment.