Browse Source

neon_news: simplify feedsUnreadCountSum

pull/380/head
Nikolas Rimikis 2 years ago
parent
commit
d45eea8339
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 7
      packages/neon/neon_news/lib/sort/folders.dart

7
packages/neon/neon_news/lib/sort/folders.dart

@ -21,9 +21,4 @@ class FolderFeedsWrapper {
final List<NextcloudNewsFeed> feeds;
}
int feedsUnreadCountSum(final List<NextcloudNewsFeed> feeds) => [
0, // Fixes error when no feeds are in the folder
...feeds.map((final f) => f.unreadCount!),
].reduce(
(final a, final b) => a + b,
);
int feedsUnreadCountSum(final List<NextcloudNewsFeed> feeds) => feeds.fold(0, (final a, final b) => a + b.unreadCount!);

Loading…
Cancel
Save