import 'dart:convert'; class ExcelDataItem { String value; String key; String? des; String? unit; String? identifier; String? referenceRange; ExcelDataItem({ required this.value, required this.key, this.des, this.unit, this.identifier, this.referenceRange, }); } class ExcelDataRecord { ///一条记录中的所有项,包含:值、单位、参考范围、描述等 List excelDatas; ExcelDataRecord(this.excelDatas); String toJson(List keys) { Map formValues = {}; var datas = excelDatas.where((element) => keys.contains(element.key)).toList(); for (var d in datas) { formValues[d.key] = d.value; } return jsonEncode(formValues); } }