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.

32 lines
710B

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