mentionsWithPopularity property

Map<String, int> get mentionsWithPopularity

Implementation

Map<String, int> get mentionsWithPopularity {
  if (_mentionsChecked) return _mentionsByPop;
  Map<String, int> _tll = {};
  _data.forEach((key, value) {
    var t = value.mentions;

    if (t.isNotEmpty) {
      t.forEach((element) {
        if (_tll[element] == null) {
          _tll[element] = 1;
          _mentions[element] = [];
        } else {
          _tll[element] = _tll[element]! + 1;
          _mentions[element]!.add(key);
        }
      });
    }
  });
  _mentionsChecked = true;
  _mentionsByPop = _tll;
  return _mentionsByPop;
}