rd-android-app/lib/models/order_item_model.dart
saritabirare 174d7afa99 1)get all Place Order api integration done
2) single Place order api integration done
3) Refresh inidicator added
4)Caps Functionality added
2024-09-11 12:24:48 +05:30

52 lines
1.1 KiB
Dart

class PlaceOrderItem1 {
final String sku;
String? id;
List<String>? image;
final String name;
final String categoryName;
final String brandName;
final double price;
final int quantity;
PlaceOrderItem1({
required this.sku,
this.id,
this.image,
required this.name,
required this.categoryName,
required this.brandName,
required this.price,
required this.quantity,
});
factory PlaceOrderItem1.fromJson(Map<String, dynamic> json) {
return PlaceOrderItem1(
id: json['id'],
sku: json['SKU'],
name: json['name'],
categoryName: json['categoryName'],
brandName: json['brandName'],
price: json['price'].toDouble(),
quantity: json['quantity'], image: null,
);
}
Map<String, dynamic> toJson() {
return {
'SKU': sku,
'name': name,
'categoryName': categoryName,
'brandName': brandName,
'price': price,
'quantity': quantity,
};
}
@override
String toString() {
return 'OrderItem(sku: $sku, name: $name, categoryName: $categoryName, '
'brandName: $brandName, price: $price, quantity: $quantity)';
}
}