mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-01-11 22:40:36 +00:00
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:
parent
67a83c0e6a
commit
e463cce61a
1 changed files with 7 additions and 7 deletions
|
|
@ -258,13 +258,13 @@ class _UpdatesScreenState extends ConsumerState<UpdatesScreen>
|
|||
}
|
||||
|
||||
ItemType getCurrentItemType() {
|
||||
return _tabBarController.index == 0 && !hideItems.contains("/MangaLibrary")
|
||||
? ItemType.manga
|
||||
: _tabBarController.index ==
|
||||
1 - (hideItems.contains("/MangaLibrary") ? 1 : 0) &&
|
||||
!hideItems.contains("/AnimeLibrary")
|
||||
? ItemType.anime
|
||||
: ItemType.novel;
|
||||
final visibleTypes = <ItemType>[
|
||||
if (!hideItems.contains("/MangaLibrary")) ItemType.manga,
|
||||
if (!hideItems.contains("/AnimeLibrary")) ItemType.anime,
|
||||
if (!hideItems.contains("/NovelLibrary")) ItemType.novel,
|
||||
];
|
||||
|
||||
return visibleTypes[_tabBarController.index];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue