getProvince static method

Future<AddressProvince?> getProvince(
  1. BuildContext context,
  2. String provinceId
)

Implementation

static Future<AddressProvince?> getProvince(BuildContext context, String provinceId) async {
  if (_provinceMap.isEmpty) {
    var provinces = await loadAddressData(context);
    if (provinces.isNotEmpty) {
      return _provinceMap[provinceId];
    }
    return null;
  } else {
    return _provinceMap[provinceId];
  }
}