comments bug fixed

This commit is contained in:
MohammadTaha Basiri 2022-03-15 12:42:51 +03:30
parent aba3d69dab
commit 0ce465e3cb
2 changed files with 2 additions and 2 deletions

View File

@ -84,7 +84,7 @@ class NewsDetailsState extends CoreProvier {
news.any((n) => newsItem != null && n != null && n.id == newsItem.id); news.any((n) => newsItem != null && n != null && n.id == newsItem.id);
void onCommentsChanged(int count) { void onCommentsChanged(int count) {
news.firstWhere((item) => item!.id == currentNews.id)!.comments = count; news.firstWhere((item) => item?.id == currentNews.id)!.comments = count;
notifyListeners(); notifyListeners();
} }

View File

@ -116,7 +116,7 @@ class RadarDetailsState extends CoreProvier {
radars.any((r) => radar != null && r != null && r.id == radar.id); radars.any((r) => radar != null && r != null && r.id == radar.id);
void onCommentsChanged(int count) { void onCommentsChanged(int count) {
radars.firstWhere((radar) => radar!.id == currentRadar.id)!.comments = radars.firstWhere((radar) => radar?.id == currentRadar.id)!.comments =
count; count;
notifyListeners(); notifyListeners();
} }