You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
860B

  1. class Device {
  2. int id;
  3. String name;
  4. String status;
  5. String location;
  6. num mode;
  7. bool isSelected;
  8. Device({this.id, this.name, this.status, this.location, this.mode});
  9. Device.clone(Device device) {
  10. this.id = device.id;
  11. this.name = device.name;
  12. this.status = device.status;
  13. this.location = device.location;
  14. this.mode = device.mode;
  15. }
  16. Device.fromJson(Map<String, dynamic> json) {
  17. id = json['id'];
  18. name = json['name'];
  19. status = json['status'];
  20. location = json['location'];
  21. mode = json['mode'];
  22. isSelected = false;
  23. }
  24. Map<String, dynamic> toJson() {
  25. final Map<String, dynamic> data = new Map<String, dynamic>();
  26. data['id'] = this.id;
  27. data['name'] = this.name;
  28. data['status'] = this.status;
  29. data['location'] = this.location;
  30. data['mode'] = this.mode;
  31. return data;
  32. }
  33. }