update product detail
This commit is contained in:
@@ -20,7 +20,7 @@ class Product {
|
||||
required this.imageCaptions,
|
||||
this.customLink360,
|
||||
required this.specifications,
|
||||
this.category,
|
||||
this.itemGroupName,
|
||||
this.brand,
|
||||
this.unit,
|
||||
this.conversionOfSm,
|
||||
@@ -58,8 +58,8 @@ class Product {
|
||||
/// Product specifications
|
||||
final Map<String, dynamic> specifications;
|
||||
|
||||
/// Category name
|
||||
final String? category;
|
||||
/// Item group name (from ERPNext)
|
||||
final String? itemGroupName;
|
||||
|
||||
/// Brand name
|
||||
final String? brand;
|
||||
@@ -97,8 +97,8 @@ class Product {
|
||||
/// Alias for primaryImage (used by UI widgets)
|
||||
String get imageUrl => primaryImage ?? '';
|
||||
|
||||
/// Category ID (alias for category field)
|
||||
String? get categoryId => category;
|
||||
/// Category ID (alias for itemGroupName field)
|
||||
String? get categoryId => itemGroupName;
|
||||
|
||||
/// Check if product has 360 view
|
||||
bool get has360View => customLink360 != null && customLink360!.isNotEmpty;
|
||||
@@ -152,7 +152,7 @@ class Product {
|
||||
Map<String, String>? imageCaptions,
|
||||
String? customLink360,
|
||||
Map<String, dynamic>? specifications,
|
||||
String? category,
|
||||
String? itemGroupName,
|
||||
String? brand,
|
||||
String? unit,
|
||||
double? conversionOfSm,
|
||||
@@ -173,7 +173,7 @@ class Product {
|
||||
imageCaptions: imageCaptions ?? this.imageCaptions,
|
||||
customLink360: customLink360 ?? this.customLink360,
|
||||
specifications: specifications ?? this.specifications,
|
||||
category: category ?? this.category,
|
||||
itemGroupName: itemGroupName ?? this.itemGroupName,
|
||||
brand: brand ?? this.brand,
|
||||
unit: unit ?? this.unit,
|
||||
conversionOfSm: conversionOfSm ?? this.conversionOfSm,
|
||||
@@ -189,7 +189,7 @@ class Product {
|
||||
@override
|
||||
String toString() {
|
||||
return 'Product(productId: $productId, name: $name, basePrice: $basePrice, '
|
||||
'category: $category, isActive: $isActive, isFeatured: $isFeatured)';
|
||||
'itemGroupName: $itemGroupName, isActive: $isActive, isFeatured: $isFeatured)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -201,7 +201,7 @@ class Product {
|
||||
other.name == name &&
|
||||
other.description == description &&
|
||||
other.basePrice == basePrice &&
|
||||
other.category == category &&
|
||||
other.itemGroupName == itemGroupName &&
|
||||
other.brand == brand &&
|
||||
other.unit == unit &&
|
||||
other.isActive == isActive &&
|
||||
@@ -216,7 +216,7 @@ class Product {
|
||||
name,
|
||||
description,
|
||||
basePrice,
|
||||
category,
|
||||
itemGroupName,
|
||||
brand,
|
||||
unit,
|
||||
isActive,
|
||||
|
||||
Reference in New Issue
Block a user