智慧水务管理系统 - 精河县供水工程综合管理平台

alert_model.dart 955B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /// 报警数据模型
  2. class AlertModel {
  3. final String id;
  4. final String title;
  5. final String level;
  6. final String station;
  7. final String content;
  8. final String time;
  9. bool isRead;
  10. AlertModel({
  11. required this.id,
  12. required this.title,
  13. required this.level,
  14. required this.station,
  15. required this.content,
  16. required this.time,
  17. this.isRead = false,
  18. });
  19. factory AlertModel.fromJson(Map<String, dynamic> json) {
  20. return AlertModel(
  21. id: json['id']?.toString() ?? '',
  22. title: json['title'] ?? '',
  23. level: json['level'] ?? 'info',
  24. station: json['station'] ?? '',
  25. content: json['content'] ?? '',
  26. time: json['time'] ?? '',
  27. isRead: json['isRead'] ?? false,
  28. );
  29. }
  30. Map<String, dynamic> toJson() {
  31. return {
  32. 'id': id,
  33. 'title': title,
  34. 'level': level,
  35. 'station': station,
  36. 'content': content,
  37. 'time': time,
  38. 'isRead': isRead,
  39. };
  40. }
  41. }