mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
fixed spaces api
This commit is contained in:
@ -9,7 +9,6 @@ class SpaceModel {
|
||||
final String name;
|
||||
final bool isPrivate;
|
||||
final String? invitationCode;
|
||||
final bool isParent;
|
||||
final SpaceModel? parent;
|
||||
final CommunityModel? community;
|
||||
final List<SpaceModel> children;
|
||||
@ -25,7 +24,6 @@ class SpaceModel {
|
||||
required this.name,
|
||||
required this.isPrivate,
|
||||
this.invitationCode,
|
||||
required this.isParent,
|
||||
this.parent,
|
||||
this.community,
|
||||
required this.children,
|
||||
@ -40,21 +38,20 @@ class SpaceModel {
|
||||
createdAt: DateTime.parse(json['createdAt']),
|
||||
updatedAt: DateTime.parse(json['updatedAt']),
|
||||
spaceTuyaUuid: json['spaceTuyaUuid'],
|
||||
name: json['name'],
|
||||
isPrivate: json['isPrivate'],
|
||||
name: json['spaceName'],
|
||||
isPrivate: json['isPrivate'] ?? false,
|
||||
invitationCode: json['invitationCode'],
|
||||
isParent: json['isParent'],
|
||||
parent:
|
||||
json['parent'] != null ? SpaceModel.fromJson(json['parent']) : null,
|
||||
community: json['community'] != null
|
||||
? CommunityModel.fromJson(json['community'])
|
||||
: null,
|
||||
children: json['children'] != null
|
||||
? (json['children'] as List)
|
||||
.map((child) => SpaceModel.fromJson(child))
|
||||
.toList()
|
||||
: [],
|
||||
icon: json['icon'],
|
||||
children: json['children'] != null
|
||||
? (json['children'] as List)
|
||||
.map((child) => SpaceModel.fromJson(child))
|
||||
.toList()
|
||||
: [],
|
||||
icon: json['icon'] as String?,
|
||||
position: json['position'] != null
|
||||
? Offset(json['position']['dx'], json['position']['dy'])
|
||||
: const Offset(0, 0),
|
||||
@ -71,7 +68,6 @@ class SpaceModel {
|
||||
'name': name,
|
||||
'isPrivate': isPrivate,
|
||||
'invitationCode': invitationCode,
|
||||
'isParent': isParent,
|
||||
'parent': parent?.toMap(),
|
||||
'community': community?.toMap(),
|
||||
'children': children.map((child) => child.toMap()).toList(),
|
||||
|
Reference in New Issue
Block a user