getDistrict static method

Future<AddressDistrict?> getDistrict(
  1. BuildContext context,
  2. String districtId
)

Implementation

static Future<AddressDistrict?> getDistrict(BuildContext context, String districtId) async {
  if (_districtMap.isEmpty) {
    var provinces = await loadAddressData(context);
    if (provinces.isNotEmpty) {
      return _districtMap[districtId];
    }
    return null;
  } else {
    return _districtMap[districtId];
  }
}