// import 'brand_model.dart'; // import 'category_model.dart'; // // class OrderItem { // final String id; // final String sku; // final String name; // final Category category; // final Brand brand; // final double price; // final double gst; // final int hsnCode; // final String description; // final String productStatus; // final String addedBy; // final List image; // final DateTime createdAt; // final DateTime updatedAt; // final int count; // // OrderItem({ // required this.id, // required this.sku, // required this.name, // required this.category, // required this.brand, // required this.price, // required this.gst, // required this.hsnCode, // required this.description, // required this.productStatus, // required this.addedBy, // required this.image, // required this.createdAt, // required this.updatedAt, // required this.count, // }); // // factory OrderItem.fromJson(Map json) { // return OrderItem( // id: json['_id'], // sku: json['SKU'], // name: json['name'], // category: Category.fromJson(json['category']), // brand: Brand.fromJson(json['brand']), // price: json['price'].toDouble(), // gst: json['GST'].toDouble(), // hsnCode: json['HSN_Code'], // description: json['description'], // productStatus: json['product_Status'], // addedBy: json['addedBy'], // image: List.from(json['image'] ?? []), // createdAt: DateTime.parse(json['createdAt']), // updatedAt: DateTime.parse(json['updatedAt']), // count: json['count'], // ); // } // // Map toJson() { // return { // '_id': id, // 'SKU': sku, // 'name': name, // 'category': category, // 'brand': brand, // 'price': price, // 'GST': gst, // 'HSN_Code': hsnCode, // 'description': description, // 'product_Status': productStatus, // 'addedBy': addedBy, // 'image': image, // 'createdAt': createdAt.toIso8601String(), // 'updatedAt': updatedAt.toIso8601String(), // 'count': count, // }; // } // } // // // // class Category { // final String id; // final String categoryName; // // Category({ // required this.id, // required this.categoryName, // }); // // factory Category.fromJson(Map json) { // return Category( // id: json['_id'], // categoryName: json['categoryName'], // ); // } // } // // class Brand { // final String id; // final String brandName; // // Brand({ // required this.id, // required this.brandName, // }); // // factory Brand.fromJson(Map json) { // return Brand( // id: json['_id'], // brandName: json['brandName'], // ); // } // } // // // // class AddedBy { // // final String id; // // final String name; // // // // AddedBy({ // // required this.id, // // required this.name, // // }); // // // // factory AddedBy.fromJson(Map json) { // // return AddedBy( // // id: json['_id'], // // name: json['name'], // // ); // // } // // }