class StockInDataXuGong { String goodsId = ""; // 物料号 double goodsNum = 0; // 物料数量 String orderNo = "test"; // 单据号 String orderType = ""; // 单据类型 String customerName = ""; // 客户名称 String goodsDesc = ""; // 物料描述 double weight = 0; // 重量 String size = ""; // 尺寸 String containerNo = ""; // 容器号 String spare1 = ""; // 备用1 String spare2 = ""; // 备用2 StockInDataXuGong({ required this.goodsId, required this.goodsNum, required this.orderNo, required this.orderType, required this.customerName, required this.goodsDesc, required this.weight, required this.size, required this.spare1, required this.spare2, required this.containerNo, }); // Updated fromJson method factory StockInDataXuGong.fromJson(Map json) { return StockInDataXuGong( goodsId: json["goodsId"] ?? "", // 物料号 goodsNum: json["goodsNum"]?.toDouble() ?? 0.0, // 物料数量 orderNo: json["orderNo"] ?? "", // 单据号 orderType: json["orderType"] ?? "", // 单据类型 customerName: json["customerName"] ?? "", // 客户名称 goodsDesc: json["goodsDesc"] ?? "", // 物料描述 weight: json["weight"]?.toDouble() ?? 0.0, // 重量 size: json["size"] ?? "", // 尺寸 containerNo: json["containerNo"] ?? "", // 容器号 spare1: json["spare1"] ?? "", // 备用1 spare2: json["spare2"] ?? "", // 备用2 ); } }