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.

34 lines
753B

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