fixed expand error

This commit is contained in:
hannathkadher
2024-10-08 20:03:31 +04:00
parent 72dfedf2b6
commit 1156af9b8e
6 changed files with 60 additions and 52 deletions

View File

@ -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,
);
}