toMap method
Convert to JSON map
Implementation
Map<String, dynamic> toMap() {
return {
'name': name,
'state': state,
'country': country,
'iso2': iso2,
'lat': lat,
'lng': lng,
'population': population,
'geoid': geoid,
if (distanceKm != null) 'distanceKm': distanceKm,
};
}