cancel direction

This commit is contained in:
Rafeek Alkhoudare
2025-05-28 06:50:04 -05:00
parent 321df401fd
commit c99b32fb81
8 changed files with 100 additions and 106 deletions

View File

@ -3,23 +3,26 @@ import 'package:syncrow_web/pages/spaces_management/all_spaces/model/space_model
class Connection {
final SpaceModel startSpace;
final SpaceModel endSpace;
final String direction;
Connection({required this.startSpace, required this.endSpace, required this.direction});
Connection({
required this.startSpace,
required this.endSpace,
});
Map<String, dynamic> toMap() {
return {
'startUuid': startSpace.uuid ?? 'unsaved-start-space-${startSpace.name}', // Fallback for unsaved spaces
'endUuid': endSpace.uuid ?? 'unsaved-end-space-${endSpace.name}', // Fallback for unsaved spaces
'direction': direction,
'startUuid': startSpace.uuid ??
'unsaved-start-space-${startSpace.name}', // Fallback for unsaved spaces
'endUuid': endSpace.uuid ??
'unsaved-end-space-${endSpace.name}', // Fallback for unsaved spaces
};
}
static Connection fromMap(Map<String, dynamic> map, Map<String, SpaceModel> spaces) {
static Connection fromMap(
Map<String, dynamic> map, Map<String, SpaceModel> spaces) {
return Connection(
startSpace: spaces[map['startUuid']]!,
endSpace: spaces[map['endUuid']]!,
direction: map['direction'],
);
}
}

View File

@ -116,7 +116,7 @@ class SpaceModel {
instance.incomingConnection = Connection(
startSpace: instance.parent ?? instance, // Parent space
endSpace: instance, // This space instance
direction: conn['direction'],
);
}