Connection.fromJson constructor

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

Implementation

factory Connection.fromJson(Map<String, dynamic> json) => (json['type'] == 0)
    ? ConnectionOut(
        connectionId: json['connection_id'],
        otherComponentId: json['other_component_id'],
      )
    : ConnectionIn(
        connectionId: json['connection_id'],
        otherComponentId: json['other_component_id'],
      );