You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.2 KiB
49 lines
1.2 KiB
import 'package:siopas/models/warehouse_mode.dart'; |
|
|
|
class M_assetStatusModel { |
|
late int id; |
|
String? seri; |
|
String? name; |
|
String? description; |
|
int? warehouseId; |
|
DateTime? date; |
|
String? qr_count; |
|
// late WarehouseModel warehouse; |
|
|
|
M_assetStatusModel({ |
|
required this.id, |
|
this.seri, |
|
this.name, |
|
this.description, |
|
this.warehouseId, |
|
this.date, |
|
this.qr_count, |
|
// required this.warehouse, |
|
}); |
|
|
|
factory M_assetStatusModel.fromJson(Map<String, dynamic> json) { |
|
return M_assetStatusModel( |
|
id: json['id'], |
|
seri: json['seri'], |
|
name: json['name'], |
|
description: json['description'], |
|
warehouseId: json['warehouse_id'] != null |
|
? int.parse(json['warehouse_id'].toString()) |
|
: null, |
|
date: json['date'] != null ? DateTime.parse(json['date']) : null, |
|
qr_count: json['qr_count'], |
|
// warehouse: WarehouseModel.fromJson(json['warehouse']), |
|
); |
|
} |
|
|
|
Map<String, dynamic> toJson() => { |
|
'id': id, |
|
'seri': seri, |
|
'name': name, |
|
'description': description, |
|
'warehouse_id': warehouseId, |
|
'date': date, |
|
'qr_count': qr_count, |
|
// 'warehouse': warehouse.toJson(), |
|
}; |
|
}
|
|
|