City.fromMap constructor

City.fromMap(
  1. Map<String, String> map
)

Factory method to create a City object from a Map.

The map must contain the keys: 'name', 'population', and 'area'.

Implementation

factory City.fromMap(Map<String, String> map) {
  return City(
    name: map['name']!,
    population: map['population']!,
    area: map['area']!,
    tehsils: map['tehsils']! as List<String>,
  );
}