models/cities library

Classes

Cities
Represents a city with its associated details such as name, location, and district ID.

Properties

slCities List<Cities>
A list of Cities objects representing the cities in your application.
final

Functions

getCitiesByDistrictId(int districtId) List<Cities>
Returns a list of Cities objects that belong to the specified district.
getCitiesByPostcode(String postcode) List<Cities>
Returns a list of Cities objects with the specified postcode.
getCityById(int id) Cities?
Returns the Cities object with the matching id, or null if no city is found.
isCityInDistrict(int cityId, int districtId) bool
Returns true if the city belongs to that district, otherwise false.
searchCitiesByNameEn(String name) List<Cities>
Returns a list of Cities objects whose English name contains the given name (case-insensitive).
searchCitiesByNameSi(String name) List<Cities>
Returns a list of Cities objects whose Sinhala name contains the given name (case-insensitive).
searchCitiesByNameTa(String name) List<Cities>
Returns a list of Cities objects whose Tamil name contains the given name (case-insensitive).