mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-15 17:47:53 +00:00
added incoming and outgoing connections
This commit is contained in:
@ -5,8 +5,21 @@ class Connection {
|
||||
final SpaceModel endSpace;
|
||||
final String direction;
|
||||
|
||||
Connection(
|
||||
{required this.startSpace,
|
||||
required this.endSpace,
|
||||
required this.direction});
|
||||
Connection({required this.startSpace, required this.endSpace, required this.direction});
|
||||
|
||||
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,
|
||||
};
|
||||
}
|
||||
|
||||
static Connection fromMap(Map<String, dynamic> map, Map<String, SpaceModel> spaces) {
|
||||
return Connection(
|
||||
startSpace: spaces[map['startUuid']]!,
|
||||
endSpace: spaces[map['endUuid']]!,
|
||||
direction: map['direction'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user