search method

Iterable<GeoLocationNode> search(
  1. String value
)

Finds the GeoLocationNode (City, or Region) with a name containing the value

Returns: A combination pf City, Region, and Country, where the name matches value, as GeoCoords

Implementation

Iterable<GeoLocationNode> search(String value) {
  final valueLowered = value.toLowerCase();
  return [
    ...countries.where((c) => c.name.toLowerCase().contains(valueLowered)),
    ...countries.map((c) => c.search(valueLowered)).expand((v) => v)
  ];
}