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 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 toJson() => { 'id': id, 'seri': seri, 'name': name, 'description': description, 'warehouse_id': warehouseId, 'date': date, 'qr_count': qr_count, // 'warehouse': warehouse.toJson(), }; }