getShippingZoneLocations method

Future<List<WooShippingZoneLocation>> getShippingZoneLocations({
  1. required int shippingZoneId,
})

Implementation

Future<List<WooShippingZoneLocation>> getShippingZoneLocations(
    {required int shippingZoneId}) async {
  List<WooShippingZoneLocation> shippingZoneLocations = [];
  _setApiResourceUrl(
      path: 'shipping/zones/' + shippingZoneId.toString() + '/locations');
  final response = await get(queryUri.toString());
  for (var l in response) {
    var sZoneLocation = WooShippingZoneLocation.fromJson(l);
    _printToLog(
        'shipping zone locations gotten here : ' + sZoneLocation.toString());
    shippingZoneLocations.add(sZoneLocation);
  }
  return shippingZoneLocations;
}