import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; class BPHistoryModel { String bpText = ''; String systolic= ''; String diastolic= ''; String date= ''; String bpId= ''; String displayDate=''; String actualDate=''; DateTime dateForFilter=new DateTime.now(); BPHistoryModel(); factory BPHistoryModel.fromJson(Map json){ BPHistoryModel rtvm = new BPHistoryModel(); rtvm.bpText = json['bpCategory'].toString() ?? ''; rtvm.systolic = json['Systolic'].toString() ?? ''; rtvm.diastolic = json['Diastolic'].toString() ?? ''; rtvm.date = json['createdAt'].toString() ?? ''; rtvm.actualDate = json['date'].toString() ?? ''; rtvm.bpId= json['bpinfoid'].toString() ?? ''; rtvm.dateForFilter = DateFormat('dd-MM-yyyy').parse(rtvm.actualDate); return rtvm; } }