validateRange method
Validates that coordinates are within valid ranges. Throws InvalidCoordsException if invalid.
Implementation
void validateRange() {
if (latitude < -90 || latitude > 90) {
throw InvalidCoordsException(
'Latitude must be between -90 and 90, got: $latitude');
}
if (longitude < -180 || longitude > 180) {
throw InvalidCoordsException(
'Longitude must be between -180 and 180, got: $longitude');
}
}