Peer.fromLine(List<String> keys, String line, [String seperator = '|'])

Source

Peer.fromLine(List<String> keys, String line, [String seperator = '|']) {
  int index = 0;
  line.split(seperator).forEach((field) {
    _map[keys[index]] = field;
    index++;
  });

  groups.add(_map['group']);
  _map.remove(['group']);

  if (contact.contains('error')) {
    _map['contact'] = null;
  }

  if (index != keys.length) {
    throw new StateError(
        'Line length does not match number of keys. Line buffer: "$line"');
  }
}