NodeSocketModel.fromJson constructor

NodeSocketModel.fromJson(
  1. Map<String, dynamic> json
)

Implementation

NodeSocketModel.fromJson(Map<String, dynamic> json)
  : id = json['id'],
    nodeId = json["node_id"],
    connectionLimit = json["max_connections"],
    type = NodeSocketType.values.firstWhere(
      (e) => e.name == json['type'],
      orElse: () => NodeSocketType.inputOutput,
    ),
    position = Vector2(json['position']['x'], json['position']['y']);