add rate service
This commit is contained in:
23
lib/domain/entities/discount_by_weight.dart
Normal file
23
lib/domain/entities/discount_by_weight.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
class DiscountByWeight {
|
||||
String id;
|
||||
double weight;
|
||||
double discount;
|
||||
|
||||
DiscountByWeight({this.id, this.weight, this.discount});
|
||||
|
||||
factory DiscountByWeight.fromMap(Map<String, dynamic> map, String id) {
|
||||
return DiscountByWeight(
|
||||
id: id,
|
||||
weight: (map['weight'] ?? 0).toDouble(),
|
||||
discount: (map['discount'] ?? 0).toDouble(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"id": id,
|
||||
'weight': weight,
|
||||
'discount': discount,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user