operator == method

  1. @override
bool operator ==(
  1. Object other
)
override

Overriding the equality operator to compare RoverPhoto objects. This is used to check if a photo is already present in the list.

Implementation

@override
bool operator ==(Object other) {
  // Equality check based on the image source URL
  return other is RoverPhoto && imgSrc == other.imgSrc;
}