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)';
  }
}

