add structure
This commit is contained in:
54
lib/vo/inventory_line.dart
Normal file
54
lib/vo/inventory_line.dart
Normal file
@@ -0,0 +1,54 @@
|
||||
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'],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user