getCityById function

Cities? getCityById(
  1. int id
)

Returns the Cities object with the matching id, or null if no city is found.

Implementation

Cities? getCityById(int id) {
  return slCities.firstWhere(
    (location) => location.id == id,
  );
}