mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 01:56:19 +00:00

Added the spaces models Added the rooms models Added the Spaces cubit Implemented the home dropdown functionality
31 lines
585 B
Dart
31 lines
585 B
Dart
import 'package:syncrow_app/features/devices/model/device_category_model.dart';
|
|
|
|
class RoomModel {
|
|
final String id;
|
|
final String name;
|
|
|
|
final List<DevicesCategoryModel> categories;
|
|
|
|
RoomModel({
|
|
required this.id,
|
|
required this.name,
|
|
required this.categories,
|
|
});
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'id': id,
|
|
'name': name,
|
|
'devices': categories,
|
|
};
|
|
}
|
|
|
|
factory RoomModel.fromJson(Map<String, dynamic> json) {
|
|
return RoomModel(
|
|
id: json['id'],
|
|
name: json['name'],
|
|
categories: json['devices'],
|
|
);
|
|
}
|
|
}
|