validateCoordinate static method
Implementation
static double validateCoordinate(Object? value, {required bool latitude}) {
final limit = latitude ? 90 : 180;
if (value is! num || !value.isFinite || value < -limit || value > limit) {
throw const FormatException(
'Map coordinates must be finite and in range.',
);
}
return value.toDouble();
}