diff --git a/packages/neon/neon_news/lib/sort/folders.dart b/packages/neon/neon_news/lib/sort/folders.dart index 50ff603d..435cc6a5 100644 --- a/packages/neon/neon_news/lib/sort/folders.dart +++ b/packages/neon/neon_news/lib/sort/folders.dart @@ -11,4 +11,4 @@ final foldersSortBox = SortBox( }, ); -typedef FolderFeedsWrapper = (NextcloudNewsFolder folder, List feeds, int unreadCount); +typedef FolderFeedsWrapper = (NextcloudNewsFolder folder, int feedCount, int unreadCount); diff --git a/packages/neon/neon_news/lib/widgets/folders_view.dart b/packages/neon/neon_news/lib/widgets/folders_view.dart index 2678ec71..6839df97 100644 --- a/packages/neon/neon_news/lib/widgets/folders_view.dart +++ b/packages/neon/neon_news/lib/widgets/folders_view.dart @@ -20,10 +20,11 @@ class NewsFoldersView extends StatelessWidget { input: feeds.data == null ? null : folders.data?.map((final folder) { - final feedsInFolder = feeds.data!.where((final feed) => feed.folderId == folder.id).toList(); + final feedsInFolder = feeds.data!.where((final feed) => feed.folderId == folder.id); + final feedCount = feedsInFolder.length; final unreadCount = feedsInFolder.fold(0, (final a, final b) => a + b.unreadCount!); - return (folder, feedsInFolder, unreadCount); + return (folder, feedCount, unreadCount); }).toList(), builder: (final context, final sorted) => NeonListView( scrollKey: 'news-folders', @@ -42,7 +43,7 @@ class NewsFoldersView extends StatelessWidget { final BuildContext context, final FolderFeedsWrapper folderFeedsWrapper, ) { - final (folder, feeds, unreadCount) = folderFeedsWrapper; + final (folder, feedCount, unreadCount) = folderFeedsWrapper; return ListTile( title: Text( folder.name, @@ -66,7 +67,7 @@ class NewsFoldersView extends StatelessWidget { ), Center( child: Text( - feeds.length.toString(), + feedCount.toString(), style: TextStyle( color: Theme.of(context).colorScheme.onPrimary, ),