NodesConnectedEvent.fromJson constructor

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

Implementation

factory NodesConnectedEvent.fromJson(Map<String, dynamic> json) {
  return NodesConnectedEvent(
    contextId: GraphObjectId.fromJson(json['contextId'] as String),
    sourceId: GraphObjectId.fromJson(json['sourceId'] as String),
    destinationId: GraphObjectId.fromJson(json['destinationId'] as String),
    sourceOutputIndex: json.containsKey('sourceOutputIndex')
        ? json['sourceOutputIndex'] as num
        : null,
    destinationInputIndex: json.containsKey('destinationInputIndex')
        ? json['destinationInputIndex'] as num
        : null,
  );
}