fromCoords static method
Implementation
static Geolocation? fromCoords(
String? coords, [
bool onlyWithCardinals = false,
]) {
if (coords == null) return null;
coords = coords.trim();
if (coords.isEmpty) return null;
// Separated by blanks, optionally after a `,` or `;` (`10.5N, 20.3E`).
// A `,` not followed by a blank is a decimal separator (`10,5N`).
var parts = coords.split(RegExp(r'\s*;\s*|,\s+|\s+'));
if (parts.length < 2) return null;
var lat = parseLatitudeOrLongitudeValue(parts[0], onlyWithCardinals);
var long = parseLatitudeOrLongitudeValue(parts[1], onlyWithCardinals);
return lat != null && long != null ? Geolocation(lat, long) : null;
}