Loop.fromJsonWithGenes constructor

Loop.fromJsonWithGenes(
  1. Map<String, dynamic> json,
  2. List<Gene> genes
)

Implementation

factory Loop.fromJsonWithGenes(Map<String, dynamic> json, List<Gene> genes) {
  var loopGene = genes.whereType<Node>().singleWhere((g) => g.identifier == json['from']);
  var link = Loop.around(loopGene);
  link.weight = json['weight'];
  link.enabled = json['enabled'];
  return link;
}