mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-11-27 07:14:56 +00:00
fixed expand error
This commit is contained in:
@ -13,7 +13,7 @@ class SpaceModel {
|
||||
final SpaceModel? parent;
|
||||
final CommunityModel? community;
|
||||
final List<SpaceModel> children;
|
||||
final String icon;
|
||||
final String? icon;
|
||||
Offset position;
|
||||
bool isHovered;
|
||||
|
||||
@ -54,11 +54,11 @@ class SpaceModel {
|
||||
.map((child) => SpaceModel.fromJson(child))
|
||||
.toList()
|
||||
: [],
|
||||
icon: json['icon'], // New field from JSON
|
||||
icon: json['icon'],
|
||||
position: json['position'] != null
|
||||
? Offset(json['position']['dx'], json['position']['dy'])
|
||||
: Offset(0, 0), // Default position if not provided in JSON
|
||||
isHovered: json['isHovered'] ?? false, // Default isHovered if not in JSON
|
||||
: const Offset(0, 0),
|
||||
isHovered: false,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user