isValidDay method
- SolDay day
Checks if a given day
satisfies the filter conditions
Implementation
bool isValidDay(SolDay day) {
// Checking if the photo count is within range
bool photoCountInRange = day.totalPhotos >= rangePhotosValuesStart &&
day.totalPhotos <= rangePhotosValuesEnd;
// Checking if the date is within range
bool dateInRange =
!day.earthDate.isBefore(startDate) && !day.earthDate.isAfter(endDate);
// Checking if any selected camera matches
bool cameraMatch =
day.cameras.any((camera) => camerasSelected.contains(camera));
return photoCountInRange && dateInRange && cameraMatch;
}