22 lines
472 B
Dart
22 lines
472 B
Dart
|
|
class ReportData {
|
||
|
|
String id;
|
||
|
|
String productName;
|
||
|
|
String productId;
|
||
|
|
int balanceQty;
|
||
|
|
|
||
|
|
ReportData({this.id, this.productName, this.productId, this.balanceQty});
|
||
|
|
|
||
|
|
factory ReportData.fromJson(Map<String, dynamic> json, String qty) {
|
||
|
|
var _qty = 0;
|
||
|
|
try {
|
||
|
|
_qty = json[qty];
|
||
|
|
} catch (e) {}
|
||
|
|
return ReportData(
|
||
|
|
id: json['id'],
|
||
|
|
productName: json['product_name'],
|
||
|
|
productId: json['product_id'],
|
||
|
|
balanceQty: _qty,
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|