add paginator
This commit is contained in:
@@ -12,6 +12,12 @@ class Rate {
|
||||
List<CustomDuty> customDuties;
|
||||
List<DiscountByWeight> discountByWeights;
|
||||
|
||||
DiscountByWeight getDiscountByWeight(double weight) {
|
||||
discountByWeights.sort((d1, d2) => d2.weight.compareTo(d1.weight));
|
||||
return discountByWeights.firstWhere((e) => e.weight < weight,
|
||||
orElse: () => null);
|
||||
}
|
||||
|
||||
CargoType get defaultCargoType => cargoTypes == null
|
||||
? null
|
||||
: cargoTypes.firstWhere((e) => e.name == "General");
|
||||
|
||||
Reference in New Issue
Block a user