addign tag model

This commit is contained in:
hannathkadher
2025-01-05 23:22:30 +04:00
parent 0fda5457ae
commit a31eb27c92
13 changed files with 190 additions and 102 deletions

View File

@ -20,7 +20,6 @@ class SpaceModel {
Offset position;
bool isHovered;
SpaceStatus status;
List<SelectedProduct> selectedProducts;
String internalId;
List<Connection> outgoingConnections = []; // Connections from this space
@ -41,7 +40,6 @@ class SpaceModel {
this.isHovered = false,
this.incomingConnection,
this.status = SpaceStatus.unchanged,
this.selectedProducts = const [],
}) : internalId = internalId ?? const Uuid().v4();
factory SpaceModel.fromJson(Map<String, dynamic> json,
@ -85,15 +83,6 @@ class SpaceModel {
icon: json['icon'] ?? Assets.location,
position: Offset(json['x'] ?? 0, json['y'] ?? 0),
isHovered: false,
selectedProducts: json['spaceProducts'] != null
? (json['spaceProducts'] as List).map((product) {
return SelectedProduct(
productId: product['product']['uuid'],
count: product['productCount'],
productName: '',
);
}).toList()
: [],
);
if (json['incomingConnections'] != null &&