mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-24 10:37:55 +00:00
Modified Category Model(default value of devices status is now null) Added a category getter in each devices cubit ( AcCubit, LightsCubit ...)
43 lines
970 B
Dart
43 lines
970 B
Dart
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'],
|
|
);
|
|
}
|
|
}
|