Make getCurrentItemType() readable

The previous version was just unnecessarily complicated, hard to read.
New version is very easy to read.
This commit is contained in:
NBA2K1 2025-12-29 00:38:33 +01:00
parent 67a83c0e6a
commit e463cce61a

View file

@ -258,13 +258,13 @@ class _UpdatesScreenState extends ConsumerState<UpdatesScreen>
} }
ItemType getCurrentItemType() { ItemType getCurrentItemType() {
return _tabBarController.index == 0 && !hideItems.contains("/MangaLibrary") final visibleTypes = <ItemType>[
? ItemType.manga if (!hideItems.contains("/MangaLibrary")) ItemType.manga,
: _tabBarController.index == if (!hideItems.contains("/AnimeLibrary")) ItemType.anime,
1 - (hideItems.contains("/MangaLibrary") ? 1 : 0) && if (!hideItems.contains("/NovelLibrary")) ItemType.novel,
!hideItems.contains("/AnimeLibrary") ];
? ItemType.anime
: ItemType.novel; return visibleTypes[_tabBarController.index];
} }
} }