55 lines
1.1 KiB
Dart
55 lines
1.1 KiB
Dart
|
|
class InventoryLine {
|
||
|
|
String storageID;
|
||
|
|
String storageName;
|
||
|
|
String productID;
|
||
|
|
String productName;
|
||
|
|
int quantity;
|
||
|
|
int oldQty;
|
||
|
|
|
||
|
|
String action;
|
||
|
|
InventoryLine(
|
||
|
|
{this.storageID,
|
||
|
|
this.storageName,
|
||
|
|
this.productID,
|
||
|
|
this.productName,
|
||
|
|
this.quantity,
|
||
|
|
this.oldQty});
|
||
|
|
|
||
|
|
@override
|
||
|
|
bool operator ==(other) {
|
||
|
|
if (identical(this, other)) {
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
return (other.storageID == this.storageID &&
|
||
|
|
other.productID == this.productID);
|
||
|
|
}
|
||
|
|
|
||
|
|
@override
|
||
|
|
int get hashCode {
|
||
|
|
int result = 17;
|
||
|
|
result = 37 * result + storageID.hashCode;
|
||
|
|
result = 37 * result + productID.hashCode;
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
|
||
|
|
Map<String, dynamic> toMap() {
|
||
|
|
return {
|
||
|
|
'storage_id': storageID,
|
||
|
|
'storage_name': storageName,
|
||
|
|
'product_id': productID,
|
||
|
|
'product_name': productName,
|
||
|
|
'quantity': quantity
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
factory InventoryLine.fromMap(Map<String, dynamic> map) {
|
||
|
|
return InventoryLine(
|
||
|
|
storageID: map['storage_id'],
|
||
|
|
storageName: map['storage_name'],
|
||
|
|
productID: map['product_id'],
|
||
|
|
productName: map['product_name'],
|
||
|
|
quantity: map['quantity'],
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|