Updated the API Endpoints, API Calls, Data Models and cubits to the lateset changes from the backend

This commit is contained in:
Mohammad Salameh
2024-04-29 10:00:58 +03:00
parent f24953a57c
commit f8358a0877
19 changed files with 255 additions and 199 deletions

View File

@ -1,11 +1,14 @@
import 'package:syncrow_app/features/devices/model/room_model.dart';
import 'package:syncrow_app/utils/resource_manager/constants.dart';
class SpaceModel {
final int? id;
final String? id;
final String? name;
final SpaceType type;
late List<RoomModel>? rooms;
SpaceModel({
required this.type,
required this.id,
required this.name,
required this.rooms,
@ -21,8 +24,9 @@ class SpaceModel {
factory SpaceModel.fromJson(Map<String, dynamic> json) {
return SpaceModel(
id: int.parse(json['homeId']),
name: json['homeName'],
id: json['uuid'],
name: json['name'],
type: spaceTypesMap[json['type']]!,
rooms: [],
);
}