fixed space

This commit is contained in:
hannathkadher
2024-10-30 09:56:57 +04:00
parent 5a7ed3ec7c
commit d025da6daf
16 changed files with 114 additions and 76 deletions

View File

@ -1,11 +1,11 @@
import 'package:syncrow_app/features/app_layout/model/community_model.dart';
import 'package:syncrow_app/features/devices/model/room_model.dart';
import 'package:syncrow_app/features/devices/model/subspace_model.dart';
class SpaceModel {
final String id;
final String name;
final Community community;
final List<SubSpaceModel> subspaces;
late List<SubSpaceModel> subspaces;
SpaceModel({
required this.id,
@ -27,7 +27,7 @@ class SpaceModel {
/// Factory constructor to create an instance from JSON.
factory SpaceModel.fromJson(Map<String, dynamic> json) {
final spaceData = json['space'] as Map<String, dynamic>? ?? {};
return SpaceModel(
id: json['uuid'] ?? '',
name: spaceData['spaceName'] ?? 'Unnamed Space',