mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-11-27 07:14:56 +00:00
added edit space option
This commit is contained in:
@ -1,14 +1,15 @@
|
||||
import 'dart:ui';
|
||||
import 'package:syncrow_web/pages/spaces_management/model/community_model.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/model/connection_model.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/model/selected_product_model.dart';
|
||||
|
||||
enum SpaceStatus { newSpace, modified, unchanged }
|
||||
|
||||
class SpaceModel {
|
||||
String? uuid;
|
||||
final String? icon;
|
||||
String? icon;
|
||||
final String? spaceTuyaUuid;
|
||||
final String name;
|
||||
String name;
|
||||
final bool isPrivate;
|
||||
final String? invitationCode;
|
||||
SpaceModel? parent;
|
||||
@ -17,6 +18,7 @@ class SpaceModel {
|
||||
Offset position;
|
||||
bool isHovered;
|
||||
SpaceStatus status;
|
||||
List<SelectedProduct> selectedProducts;
|
||||
|
||||
List<Connection> outgoingConnections = []; // Connections from this space
|
||||
Connection? incomingConnection; // Connections to this space
|
||||
@ -35,6 +37,7 @@ class SpaceModel {
|
||||
this.isHovered = false,
|
||||
this.incomingConnection,
|
||||
this.status = SpaceStatus.unchanged,
|
||||
this.selectedProducts = const [],
|
||||
});
|
||||
|
||||
factory SpaceModel.fromJson(Map<String, dynamic> json) {
|
||||
@ -72,19 +75,6 @@ class SpaceModel {
|
||||
|
||||
return instance;
|
||||
}
|
||||
@override
|
||||
String toString() {
|
||||
return '''
|
||||
SpaceModel {
|
||||
uuid: $uuid,
|
||||
name: $name,
|
||||
isPrivate: $isPrivate,
|
||||
position: {dx: ${position.dx}, dy: ${position.dy}},
|
||||
parentUuid: ${parent?.uuid},
|
||||
children: ${children.map((child) => child.name).toList()},
|
||||
isHovered: $isHovered
|
||||
}''';
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user