tryParse static method

GeoPoint2? tryParse(
  1. String text, {
  2. ParseCoords? parser,
})

A point parsed from text with coordinates in order: lon, lat.

If parser is null, then WKT text like "10.0 20.0" is expected.

Returns null if cannot parse.

Implementation

static GeoPoint2? tryParse(String text, {ParseCoords? parser}) {
  try {
    return GeoPoint2.parse(text, parser: parser);
  } on Exception {
    return null;
  }
}