survivorSquads property

Map<String, List<STWWorker>> survivorSquads

returns survivor squads of the profile. there are 8 survivors squads in total. each squad can have a max of 8 survivors.

Implementation

Map<String, List<STWWorker>> get survivorSquads {
  Map<String, List<STWWorker>> _squads = {
    "trainingteam": [],
    "fireteamalpha": [],
    "closeassaultsquad": [],
    "thethinktank": [],
    "emtsquad": [],
    "corpsofengineering": [],
    "scoutingparty": [],
    "gadgeteers": [],
  };

  for (STWWorker worker
      in workers.where((element) => element.squad != null)) {
    _squads[worker.squad?["name"]]?.add(worker);
  }

  return _squads;
}