delete Space

This commit is contained in:
hannathkadher
2024-11-21 11:52:27 +04:00
parent 6bc6097a7e
commit 8a7f9ab2dc
11 changed files with 353 additions and 46 deletions

View File

@ -58,6 +58,14 @@ class SpaceModel {
? Offset(json['x'], json['y'])
: const Offset(0, 0),
isHovered: false,
selectedProducts: json['spaceProducts'] != null
? (json['spaceProducts'] as List).map((product) {
return SelectedProduct(
productId: product['product']['uuid'],
count: product['productCount'],
);
}).toList()
: [],
);
// Add incomingConnection to the instance after creation
@ -97,4 +105,18 @@ class SpaceModel {
void addOutgoingConnection(Connection connection) {
outgoingConnections.add(connection);
}
@override
String toString() {
return '''
SpaceModel(
uuid: $uuid,
name: $name,
icon: $icon,
isPrivate: $isPrivate,
position: $position,
selectedProducts: $selectedProducts
)
''';
}
}