getCity static method

Future<AddressCity?> getCity(
  1. BuildContext context,
  2. String cityId
)

Implementation

static Future<AddressCity?> getCity(BuildContext context, String cityId) async {
  if (_cityMap.isEmpty) {
    var provinces = await loadAddressData(context);
    if (provinces.isNotEmpty) {
      return _cityMap[cityId];
    }
    return null;
  } else {
    return _cityMap[cityId];
  }
}