mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-26 20:14:54 +00:00
Added the spaces models Added the rooms models Added the Spaces cubit Implemented the home dropdown functionality
40 lines
879 B
Dart
40 lines
879 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.image,
|
|
required super.timer,
|
|
});
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'openPercentage': openPercentage,
|
|
'timer': timer,
|
|
'id': id,
|
|
'name': name,
|
|
'status': status,
|
|
'type': type,
|
|
'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'],
|
|
image: json['image'],
|
|
);
|
|
}
|
|
}
|