Add status model and fetch device statuses

Added a new StatusModel class to represent device statuses and implemented
functionality to fetch and update device statuses in the DevicesCubit and
DeviceModel classes. Also updated UI components to display device status
information.
This commit is contained in:
Mohammad Salameh
2024-04-03 11:07:55 +03:00
parent 5ff5f65549
commit e49627d3e1
8 changed files with 134 additions and 32 deletions
@@ -0,0 +1,23 @@
class StatusModel {
String? code;
dynamic value;
StatusModel({
required this.code,
required this.value,
});
factory StatusModel.fromJson(Map<String, dynamic> json) {
return StatusModel(
code: json['code'],
value: json['value'],
);
}
Map<String, dynamic> toJson() {
return {
'code': code,
'value': value,
};
}
}