mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 16:47:56 +00:00
Built Curtains List view
Modified Category Model(default value of devices status is now null) Added a category getter in each devices cubit ( AcCubit, LightsCubit ...)
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||
|
||||
class CurtainModel extends DeviceModel {
|
||||
late int openPercentage;
|
||||
|
||||
CurtainModel({
|
||||
required this.openPercentage,
|
||||
required super.id,
|
||||
required super.name,
|
||||
required super.type,
|
||||
required super.status,
|
||||
required super.location,
|
||||
required super.image,
|
||||
required super.timer,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'openPercentage': openPercentage,
|
||||
'timer': timer,
|
||||
'id': id,
|
||||
'name': name,
|
||||
'status': status,
|
||||
'type': type,
|
||||
'location': location,
|
||||
'image': image,
|
||||
};
|
||||
}
|
||||
|
||||
factory CurtainModel.fromJson(Map<String, dynamic> json) {
|
||||
return CurtainModel(
|
||||
id: json['id'],
|
||||
name: json['name'],
|
||||
status: json['status'],
|
||||
openPercentage: json['openPercentage'],
|
||||
timer: json['timer'],
|
||||
type: json['type'],
|
||||
location: json['location'],
|
||||
image: json['image'],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ class DevicesCategoryModel {
|
||||
|
||||
final Widget page;
|
||||
|
||||
bool? devicesStatus = false;
|
||||
bool? devicesStatus;
|
||||
final List<DeviceModel> devices;
|
||||
|
||||
final DeviceType type;
|
||||
@@ -32,8 +32,6 @@ class DevicesCategoryModel {
|
||||
}
|
||||
}
|
||||
devicesStatus = tempStatus;
|
||||
} else {
|
||||
devicesStatus = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user