allow user to reorder and toggle each navigation item
This commit is contained in:
parent
7bc3061485
commit
235db734d2
15 changed files with 1036 additions and 726 deletions
|
|
@ -385,7 +385,8 @@
|
|||
"n_day_ago": "Vor {day} Tag",
|
||||
"now": "jetzt",
|
||||
"library_last_updated": "Bibliothek zuletzt am {lastUpdated} aktualisiert.",
|
||||
"reorder_navigation": "Passe die Navigation für dich selber an.",
|
||||
"reorder_navigation": "Navigation anpassen",
|
||||
"reorder_navigation_description": "Du kannst die Anordnung und Sichbarheit der Navigation für dich selber anpassen.",
|
||||
"hide_manga": "Einige Elemente bezüglich Mangas ausblenden.",
|
||||
"hide_anime": "Einige Elemente bezüglich Animes ausblenden.",
|
||||
"hide_novel": "Einige Elemente bezüglich (Light-)Novels ausblenden.",
|
||||
|
|
|
|||
|
|
@ -215,7 +215,8 @@
|
|||
"sync_confirm_download": "A full download will completely replace your current data with the remote one!",
|
||||
"dialog_confirm": "Confirm",
|
||||
"description": "Description",
|
||||
"reorder_navigation": "Customize the navigation to your needs.",
|
||||
"reorder_navigation": "Customize navigation",
|
||||
"reorder_navigation_description": "Reorder and toggle each navigation to your needs.",
|
||||
"hide_manga": "Hide some elements related to mangas.",
|
||||
"hide_anime": "Hide some elements related to animes.",
|
||||
"hide_novel": "Hide some elements related to (light) novels.",
|
||||
|
|
|
|||
|
|
@ -220,11 +220,9 @@ class Settings {
|
|||
@enumerated
|
||||
late NovelTextAlign novelTextAlign;
|
||||
|
||||
bool? hideManga;
|
||||
List<String>? navigationOrder;
|
||||
|
||||
bool? hideAnime;
|
||||
|
||||
bool? hideNovel;
|
||||
List<String>? hideItems;
|
||||
|
||||
bool? clearChapterCacheOnAppLaunch;
|
||||
|
||||
|
|
@ -325,9 +323,8 @@ class Settings {
|
|||
this.novelDisplayType = DisplayType.comfortableGrid,
|
||||
this.novelFontSize = 14,
|
||||
this.novelTextAlign = NovelTextAlign.left,
|
||||
this.hideManga = false,
|
||||
this.hideAnime = false,
|
||||
this.hideNovel = false,
|
||||
this.navigationOrder,
|
||||
this.hideItems,
|
||||
this.clearChapterCacheOnAppLaunch = false});
|
||||
|
||||
Settings.fromJson(Map<String, dynamic> json) {
|
||||
|
|
@ -503,9 +500,8 @@ class Settings {
|
|||
}
|
||||
novelTextAlign = NovelTextAlign
|
||||
.values[json['novelTextAlign'] ?? NovelTextAlign.left.index];
|
||||
hideManga = json['hideManga'];
|
||||
hideAnime = json['hideAnime'];
|
||||
hideNovel = json['hideNovel'];
|
||||
navigationOrder = json['navigationOrder']?.cast<String>();
|
||||
hideItems = json['hideItems']?.cast<String>();
|
||||
clearChapterCacheOnAppLaunch = json['clearChapterCacheOnAppLaunch'];
|
||||
}
|
||||
|
||||
|
|
@ -621,9 +617,8 @@ class Settings {
|
|||
'novelDisplayType': novelDisplayType.index,
|
||||
'novelFontSize': novelFontSize,
|
||||
'novelTextAlign': novelTextAlign.index,
|
||||
'hideManga': hideManga,
|
||||
'hideAnime': hideAnime,
|
||||
'hideNovel': hideNovel,
|
||||
'navigationOrder': navigationOrder,
|
||||
'hideItems': hideItems,
|
||||
'clearChapterCacheOnAppLaunch': clearChapterCacheOnAppLaunch
|
||||
};
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -22,18 +22,16 @@ class BrowseScreen extends ConsumerStatefulWidget {
|
|||
|
||||
class _BrowseScreenState extends ConsumerState<BrowseScreen>
|
||||
with TickerProviderStateMixin {
|
||||
late final hideManga = ref.watch(hideMangaStateProvider);
|
||||
late final hideAnime = ref.watch(hideAnimeStateProvider);
|
||||
late final hideNovel = ref.watch(hideNovelStateProvider);
|
||||
late final hideItems = ref.watch(hideItemsStateProvider);
|
||||
late TabController _tabBarController;
|
||||
|
||||
late final _tabList = [
|
||||
if (!hideManga) 'manga',
|
||||
if (!hideAnime) 'anime',
|
||||
if (!hideNovel) 'novel',
|
||||
if (!hideManga) 'mangaExtension',
|
||||
if (!hideAnime) 'animeExtension',
|
||||
if (!hideNovel) 'novelExtension',
|
||||
if (!hideItems.contains("/MangaLibrary")) 'manga',
|
||||
if (!hideItems.contains("/AnimeLibrary")) 'anime',
|
||||
if (!hideItems.contains("/NovelLibrary")) 'novel',
|
||||
if (!hideItems.contains("/MangaLibrary")) 'mangaExtension',
|
||||
if (!hideItems.contains("/AnimeLibrary")) 'animeExtension',
|
||||
if (!hideItems.contains("/NovelLibrary")) 'novelExtension',
|
||||
];
|
||||
|
||||
@override
|
||||
|
|
@ -151,10 +149,10 @@ class _BrowseScreenState extends ConsumerState<BrowseScreen>
|
|||
isScrollable: true,
|
||||
controller: _tabBarController,
|
||||
tabs: [
|
||||
if (!hideManga) Tab(text: l10n.manga_sources),
|
||||
if (!hideAnime) Tab(text: l10n.anime_sources),
|
||||
if (!hideNovel) Tab(text: l10n.novel_sources),
|
||||
if (!hideManga)
|
||||
if (!hideItems.contains("/MangaLibrary")) Tab(text: l10n.manga_sources),
|
||||
if (!hideItems.contains("/AnimeLibrary")) Tab(text: l10n.anime_sources),
|
||||
if (!hideItems.contains("/NovelLibrary")) Tab(text: l10n.novel_sources),
|
||||
if (!hideItems.contains("/MangaLibrary"))
|
||||
Tab(
|
||||
child: Row(
|
||||
children: [
|
||||
|
|
@ -164,7 +162,7 @@ class _BrowseScreenState extends ConsumerState<BrowseScreen>
|
|||
],
|
||||
),
|
||||
),
|
||||
if (!hideAnime)
|
||||
if (!hideItems.contains("/AnimeLibrary"))
|
||||
Tab(
|
||||
child: Row(
|
||||
children: [
|
||||
|
|
@ -174,7 +172,7 @@ class _BrowseScreenState extends ConsumerState<BrowseScreen>
|
|||
],
|
||||
),
|
||||
),
|
||||
if (!hideNovel)
|
||||
if (!hideItems.contains("/NovelLibrary"))
|
||||
Tab(
|
||||
child: Row(
|
||||
children: [
|
||||
|
|
@ -187,34 +185,34 @@ class _BrowseScreenState extends ConsumerState<BrowseScreen>
|
|||
]),
|
||||
),
|
||||
body: TabBarView(controller: _tabBarController, children: [
|
||||
if (!hideManga)
|
||||
if (!hideItems.contains("/MangaLibrary"))
|
||||
SourcesScreen(
|
||||
itemType: ItemType.manga,
|
||||
tabIndex: (index) {
|
||||
_tabBarController.animateTo(index);
|
||||
},
|
||||
),
|
||||
if (!hideAnime)
|
||||
if (!hideItems.contains("/AnimeLibrary"))
|
||||
SourcesScreen(
|
||||
itemType: ItemType.anime,
|
||||
tabIndex: (index) {
|
||||
_tabBarController.animateTo(index);
|
||||
},
|
||||
),
|
||||
if (!hideNovel)
|
||||
if (!hideItems.contains("/NovelLibrary"))
|
||||
SourcesScreen(
|
||||
itemType: ItemType.novel,
|
||||
tabIndex: (index) {
|
||||
_tabBarController.animateTo(index);
|
||||
},
|
||||
),
|
||||
if (!hideManga)
|
||||
if (!hideItems.contains("/MangaLibrary"))
|
||||
ExtensionScreen(
|
||||
query: _textEditingController.text, itemType: ItemType.manga),
|
||||
if (!hideAnime)
|
||||
if (!hideItems.contains("/AnimeLibrary"))
|
||||
ExtensionScreen(
|
||||
query: _textEditingController.text, itemType: ItemType.anime),
|
||||
if (!hideNovel)
|
||||
if (!hideItems.contains("/NovelLibrary"))
|
||||
ExtensionScreen(
|
||||
query: _textEditingController.text, itemType: ItemType.novel),
|
||||
]),
|
||||
|
|
|
|||
|
|
@ -54,13 +54,11 @@ class _HistoryScreenState extends ConsumerState<HistoryScreen>
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
int newTabs = 0;
|
||||
final hideManga = ref.watch(hideMangaStateProvider);
|
||||
final hideAnime = ref.watch(hideAnimeStateProvider);
|
||||
final hideNovel = ref.watch(hideNovelStateProvider);
|
||||
final hideItems = ref.watch(hideItemsStateProvider);
|
||||
|
||||
if (!hideManga) newTabs++;
|
||||
if (!hideAnime) newTabs++;
|
||||
if (!hideNovel) newTabs++;
|
||||
if (!hideItems.contains("/MangaLibrary")) newTabs++;
|
||||
if (!hideItems.contains("/AnimeLibrary")) newTabs++;
|
||||
if (!hideItems.contains("/NovelLibrary")) newTabs++;
|
||||
if (newTabs == 0) {
|
||||
return SizedBox.shrink();
|
||||
}
|
||||
|
|
@ -147,14 +145,17 @@ class _HistoryScreenState extends ConsumerState<HistoryScreen>
|
|||
.itemTypeEqualTo(_tabBarController
|
||||
.index ==
|
||||
0 &&
|
||||
!hideManga
|
||||
!hideItems.contains(
|
||||
"/MangaLibrary")
|
||||
? ItemType.manga
|
||||
: _tabBarController.index ==
|
||||
1 -
|
||||
(hideManga
|
||||
(hideItems.contains(
|
||||
"/MangaLibrary")
|
||||
? 1
|
||||
: 0) &&
|
||||
!hideAnime
|
||||
!hideItems.contains(
|
||||
"/AnimeLibrary")
|
||||
? ItemType.anime
|
||||
: ItemType.novel)))
|
||||
.findAllSync()
|
||||
|
|
@ -182,26 +183,26 @@ class _HistoryScreenState extends ConsumerState<HistoryScreen>
|
|||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
controller: _tabBarController,
|
||||
tabs: [
|
||||
if (!hideManga) Tab(text: l10n.manga),
|
||||
if (!hideAnime) Tab(text: l10n.anime),
|
||||
if (!hideNovel) Tab(text: l10n.novel),
|
||||
if (!hideItems.contains("/MangaLibrary")) Tab(text: l10n.manga),
|
||||
if (!hideItems.contains("/AnimeLibrary")) Tab(text: l10n.anime),
|
||||
if (!hideItems.contains("/NovelLibrary")) Tab(text: l10n.novel),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: TabBarView(controller: _tabBarController, children: [
|
||||
if (!hideManga)
|
||||
if (!hideItems.contains("/MangaLibrary"))
|
||||
HistoryTab(
|
||||
itemType: ItemType.manga,
|
||||
query: _textEditingController.text,
|
||||
),
|
||||
if (!hideAnime)
|
||||
if (!hideItems.contains("/AnimeLibrary"))
|
||||
HistoryTab(
|
||||
itemType: ItemType.anime,
|
||||
query: _textEditingController.text,
|
||||
),
|
||||
if (!hideNovel)
|
||||
if (!hideItems.contains("/NovelLibrary"))
|
||||
HistoryTab(
|
||||
itemType: ItemType.novel,
|
||||
query: _textEditingController.text,
|
||||
|
|
|
|||
|
|
@ -51,18 +51,10 @@ class _MainScreenState extends ConsumerState<MainScreen> {
|
|||
}
|
||||
}
|
||||
|
||||
late bool hideManga = ref.watch(hideMangaStateProvider);
|
||||
late bool hideAnime = ref.watch(hideAnimeStateProvider);
|
||||
late bool hideNovel = ref.watch(hideNovelStateProvider);
|
||||
late final navigationOrder = ref.watch(navigationOrderStateProvider);
|
||||
late String? location =
|
||||
ref.watch(routerCurrentLocationStateProvider(context));
|
||||
late String defaultLocation = hideManga
|
||||
? hideAnime
|
||||
? hideNovel
|
||||
? '/more'
|
||||
: '/NovelLibrary'
|
||||
: '/AnimeLibrary'
|
||||
: '/MangaLibrary';
|
||||
late String defaultLocation = navigationOrder.first;
|
||||
@override
|
||||
initState() {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
|
|
@ -84,33 +76,17 @@ class _MainScreenState extends ConsumerState<MainScreen> {
|
|||
Widget build(BuildContext context) {
|
||||
final l10n = context.l10n;
|
||||
final route = GoRouter.of(context);
|
||||
final navigationOrder = ref.watch(navigationOrderStateProvider);
|
||||
final hideItems = ref.watch(hideItemsStateProvider);
|
||||
location = ref.watch(routerCurrentLocationStateProvider(context));
|
||||
return ref.watch(migrationProvider).when(data: (_) {
|
||||
return Consumer(builder: (context, ref, chuld) {
|
||||
hideManga = ref.watch(hideMangaStateProvider);
|
||||
hideAnime = ref.watch(hideAnimeStateProvider);
|
||||
hideNovel = ref.watch(hideNovelStateProvider);
|
||||
bool isReadingScreen = location == '/mangaReaderView' ||
|
||||
location == '/animePlayerView' ||
|
||||
location == '/novelReaderView';
|
||||
final dest = [
|
||||
'/MangaLibrary',
|
||||
'/AnimeLibrary',
|
||||
'/NovelLibrary',
|
||||
'/updates',
|
||||
'/history',
|
||||
'/browse',
|
||||
'/more'
|
||||
];
|
||||
if (hideManga) {
|
||||
dest.removeWhere((d) => d == "/MangaLibrary");
|
||||
}
|
||||
if (hideAnime) {
|
||||
dest.removeWhere((d) => d == "/AnimeLibrary");
|
||||
}
|
||||
if (hideNovel) {
|
||||
dest.removeWhere((d) => d == "/NovelLibrary");
|
||||
}
|
||||
final dest =
|
||||
navigationOrder.where((nav) => !hideItems.contains(nav)).toList();
|
||||
|
||||
int currentIndex = dest.indexOf(location ?? defaultLocation);
|
||||
if (currentIndex == -1) {
|
||||
currentIndex = dest.length - 1;
|
||||
|
|
@ -183,91 +159,9 @@ class _MainScreenState extends ConsumerState<MainScreen> {
|
|||
return NavigationRail(
|
||||
labelType: NavigationRailLabelType.all,
|
||||
useIndicator: true,
|
||||
destinations: [
|
||||
if (!hideManga)
|
||||
NavigationRailDestination(
|
||||
selectedIcon: const Icon(
|
||||
Icons.collections_bookmark),
|
||||
icon: const Icon(Icons
|
||||
.collections_bookmark_outlined),
|
||||
label: Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(
|
||||
top: 5),
|
||||
child: Text(l10n.manga))),
|
||||
if (!hideAnime)
|
||||
NavigationRailDestination(
|
||||
selectedIcon: const Icon(
|
||||
Icons.video_collection),
|
||||
icon: const Icon(Icons
|
||||
.video_collection_outlined),
|
||||
label: Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(
|
||||
top: 5),
|
||||
child: Text(l10n.anime))),
|
||||
if (!hideNovel)
|
||||
NavigationRailDestination(
|
||||
selectedIcon: const Icon(
|
||||
Icons.local_library),
|
||||
icon: const Icon(
|
||||
Icons.local_library_outlined),
|
||||
label: Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(
|
||||
top: 5),
|
||||
child: Text(l10n.novel))),
|
||||
NavigationRailDestination(
|
||||
selectedIcon: _updatesTotalNumbers(
|
||||
ref, Icon(Icons.new_releases)),
|
||||
icon: _updatesTotalNumbers(
|
||||
ref,
|
||||
Icon(Icons
|
||||
.new_releases_outlined)),
|
||||
label: Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
getHyphenatedUpdatesLabel(
|
||||
ref
|
||||
.watch(
|
||||
l10nLocaleStateProvider)
|
||||
.languageCode,
|
||||
l10n.updates,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
)),
|
||||
NavigationRailDestination(
|
||||
selectedIcon:
|
||||
const Icon(Icons.history),
|
||||
icon: const Icon(
|
||||
Icons.history_outlined),
|
||||
label: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 5),
|
||||
child: Text(l10n.history))),
|
||||
NavigationRailDestination(
|
||||
selectedIcon:
|
||||
_extensionUpdateTotalNumbers(
|
||||
ref, Icon(Icons.explore)),
|
||||
icon: _extensionUpdateTotalNumbers(
|
||||
ref,
|
||||
Icon(Icons.explore_outlined)),
|
||||
label: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 5),
|
||||
child: Text(l10n.browse))),
|
||||
NavigationRailDestination(
|
||||
selectedIcon:
|
||||
const Icon(Icons.more_horiz),
|
||||
icon: const Icon(
|
||||
Icons.more_horiz_outlined),
|
||||
label: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 5),
|
||||
child: Text(l10n.more))),
|
||||
],
|
||||
destinations:
|
||||
_buildNavigationWidgetsDesktop(
|
||||
ref, dest, context),
|
||||
selectedIndex: currentIndex,
|
||||
onDestinationSelected: (newIndex) {
|
||||
route.go(dest[newIndex]);
|
||||
|
|
@ -313,49 +207,8 @@ class _MainScreenState extends ConsumerState<MainScreen> {
|
|||
animationDuration:
|
||||
const Duration(milliseconds: 500),
|
||||
selectedIndex: currentIndex,
|
||||
destinations: [
|
||||
if (!hideManga)
|
||||
NavigationDestination(
|
||||
selectedIcon:
|
||||
const Icon(Icons.collections_bookmark),
|
||||
icon: const Icon(
|
||||
Icons.collections_bookmark_outlined),
|
||||
label: l10n.manga),
|
||||
if (!hideAnime)
|
||||
NavigationDestination(
|
||||
selectedIcon:
|
||||
const Icon(Icons.video_collection),
|
||||
icon: const Icon(
|
||||
Icons.video_collection_outlined),
|
||||
label: l10n.anime),
|
||||
if (!hideNovel)
|
||||
NavigationDestination(
|
||||
selectedIcon:
|
||||
const Icon(Icons.local_library),
|
||||
icon: const Icon(
|
||||
Icons.local_library_outlined),
|
||||
label: l10n.novel),
|
||||
NavigationDestination(
|
||||
selectedIcon: _updatesTotalNumbers(
|
||||
ref, Icon(Icons.new_releases)),
|
||||
icon: _updatesTotalNumbers(
|
||||
ref, Icon(Icons.new_releases_outlined)),
|
||||
label: l10n.updates),
|
||||
NavigationDestination(
|
||||
selectedIcon: const Icon(Icons.history),
|
||||
icon: const Icon(Icons.history_outlined),
|
||||
label: l10n.history),
|
||||
NavigationDestination(
|
||||
selectedIcon: _extensionUpdateTotalNumbers(
|
||||
ref, Icon(Icons.explore)),
|
||||
icon: _extensionUpdateTotalNumbers(
|
||||
ref, Icon(Icons.explore_outlined)),
|
||||
label: l10n.browse),
|
||||
NavigationDestination(
|
||||
selectedIcon: const Icon(Icons.more_horiz),
|
||||
icon: const Icon(Icons.more_horiz_outlined),
|
||||
label: l10n.more),
|
||||
],
|
||||
destinations: _buildNavigationWidgetsMobile(
|
||||
ref, dest, context),
|
||||
onDestinationSelected: (newIndex) {
|
||||
route.go(dest[newIndex]);
|
||||
},
|
||||
|
|
@ -373,18 +226,136 @@ class _MainScreenState extends ConsumerState<MainScreen> {
|
|||
return const LoadingIcon();
|
||||
});
|
||||
}
|
||||
|
||||
List<NavigationRailDestination> _buildNavigationWidgetsDesktop(
|
||||
WidgetRef ref, List<String> dest, BuildContext context) {
|
||||
final l10n = context.l10n;
|
||||
final destinations =
|
||||
List<NavigationRailDestination?>.filled(dest.length, null);
|
||||
if (dest.contains("/MangaLibrary")) {
|
||||
destinations[dest.indexOf("/MangaLibrary")] = NavigationRailDestination(
|
||||
selectedIcon: const Icon(Icons.collections_bookmark),
|
||||
icon: const Icon(Icons.collections_bookmark_outlined),
|
||||
label: Padding(
|
||||
padding: const EdgeInsets.only(top: 5), child: Text(l10n.manga)));
|
||||
}
|
||||
if (dest.contains("/AnimeLibrary")) {
|
||||
destinations[dest.indexOf("/AnimeLibrary")] = NavigationRailDestination(
|
||||
selectedIcon: const Icon(Icons.video_collection),
|
||||
icon: const Icon(Icons.video_collection_outlined),
|
||||
label: Padding(
|
||||
padding: const EdgeInsets.only(top: 5), child: Text(l10n.anime)));
|
||||
}
|
||||
if (dest.contains("/NovelLibrary")) {
|
||||
destinations[dest.indexOf("/NovelLibrary")] = NavigationRailDestination(
|
||||
selectedIcon: const Icon(Icons.local_library),
|
||||
icon: const Icon(Icons.local_library_outlined),
|
||||
label: Padding(
|
||||
padding: const EdgeInsets.only(top: 5), child: Text(l10n.novel)));
|
||||
}
|
||||
if (dest.contains("/updates")) {
|
||||
destinations[dest.indexOf("/updates")] = NavigationRailDestination(
|
||||
selectedIcon: _updatesTotalNumbers(ref, Icon(Icons.new_releases)),
|
||||
icon: _updatesTotalNumbers(ref, Icon(Icons.new_releases_outlined)),
|
||||
label: Padding(
|
||||
padding: const EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
getHyphenatedUpdatesLabel(
|
||||
ref.watch(l10nLocaleStateProvider).languageCode,
|
||||
l10n.updates,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
));
|
||||
}
|
||||
if (dest.contains("/history")) {
|
||||
destinations[dest.indexOf("/history")] = NavigationRailDestination(
|
||||
selectedIcon: const Icon(Icons.history),
|
||||
icon: const Icon(Icons.history_outlined),
|
||||
label: Padding(
|
||||
padding: const EdgeInsets.only(top: 5),
|
||||
child: Text(l10n.history)));
|
||||
}
|
||||
if (dest.contains("/browse")) {
|
||||
destinations[dest.indexOf("/browse")] = NavigationRailDestination(
|
||||
selectedIcon: _extensionUpdateTotalNumbers(ref, Icon(Icons.explore)),
|
||||
icon: _extensionUpdateTotalNumbers(ref, Icon(Icons.explore_outlined)),
|
||||
label: Padding(
|
||||
padding: const EdgeInsets.only(top: 5),
|
||||
child: Text(l10n.browse)));
|
||||
}
|
||||
if (dest.contains("/more")) {
|
||||
destinations[dest.indexOf("/more")] = NavigationRailDestination(
|
||||
selectedIcon: const Icon(Icons.more_horiz),
|
||||
icon: const Icon(Icons.more_horiz_outlined),
|
||||
label: Padding(
|
||||
padding: const EdgeInsets.only(top: 5), child: Text(l10n.more)));
|
||||
}
|
||||
return destinations.nonNulls.toList();
|
||||
}
|
||||
|
||||
List<Widget> _buildNavigationWidgetsMobile(
|
||||
WidgetRef ref, List<String> dest, BuildContext context) {
|
||||
final l10n = context.l10n;
|
||||
final destinations =
|
||||
List<Widget>.filled(dest.length, const SizedBox.shrink());
|
||||
if (dest.contains("/MangaLibrary")) {
|
||||
destinations[dest.indexOf("/MangaLibrary")] = NavigationDestination(
|
||||
selectedIcon: const Icon(Icons.collections_bookmark),
|
||||
icon: const Icon(Icons.collections_bookmark_outlined),
|
||||
label: l10n.manga);
|
||||
}
|
||||
if (dest.contains("/AnimeLibrary")) {
|
||||
destinations[dest.indexOf("/AnimeLibrary")] = NavigationDestination(
|
||||
selectedIcon: const Icon(Icons.video_collection),
|
||||
icon: const Icon(Icons.video_collection_outlined),
|
||||
label: l10n.anime);
|
||||
}
|
||||
if (dest.contains("/NovelLibrary")) {
|
||||
destinations[dest.indexOf("/NovelLibrary")] = NavigationDestination(
|
||||
selectedIcon: const Icon(Icons.local_library),
|
||||
icon: const Icon(Icons.local_library_outlined),
|
||||
label: l10n.novel);
|
||||
}
|
||||
if (dest.contains("/updates")) {
|
||||
destinations[dest.indexOf("/updates")] = NavigationDestination(
|
||||
selectedIcon: _updatesTotalNumbers(ref, Icon(Icons.new_releases)),
|
||||
icon: _updatesTotalNumbers(ref, Icon(Icons.new_releases_outlined)),
|
||||
label: l10n.updates);
|
||||
}
|
||||
if (dest.contains("/history")) {
|
||||
destinations[dest.indexOf("/history")] = NavigationDestination(
|
||||
selectedIcon: const Icon(Icons.history),
|
||||
icon: const Icon(Icons.history_outlined),
|
||||
label: l10n.history);
|
||||
}
|
||||
if (dest.contains("/browse")) {
|
||||
destinations[dest.indexOf("/browse")] = NavigationDestination(
|
||||
selectedIcon: _extensionUpdateTotalNumbers(ref, Icon(Icons.explore)),
|
||||
icon: _extensionUpdateTotalNumbers(ref, Icon(Icons.explore_outlined)),
|
||||
label: l10n.browse);
|
||||
}
|
||||
if (dest.contains("/more")) {
|
||||
destinations[dest.indexOf("/more")] = NavigationDestination(
|
||||
selectedIcon: const Icon(Icons.more_horiz),
|
||||
icon: const Icon(Icons.more_horiz_outlined),
|
||||
label: l10n.more);
|
||||
}
|
||||
return destinations;
|
||||
}
|
||||
}
|
||||
|
||||
Widget _extensionUpdateTotalNumbers(WidgetRef ref, Widget widget) {
|
||||
final hideItems = ref.watch(hideItemsStateProvider);
|
||||
return StreamBuilder(
|
||||
stream: isar.sources
|
||||
.filter()
|
||||
.idIsNotNull()
|
||||
.optional(ref.watch(hideMangaStateProvider),
|
||||
.optional(hideItems.contains("/MangaLibrary"),
|
||||
(q) => q.not().itemTypeEqualTo(ItemType.manga))
|
||||
.optional(ref.watch(hideAnimeStateProvider),
|
||||
.optional(hideItems.contains("/AnimeLibrary"),
|
||||
(q) => q.not().itemTypeEqualTo(ItemType.anime))
|
||||
.optional(ref.watch(hideNovelStateProvider),
|
||||
.optional(hideItems.contains("/NovelLibrary"),
|
||||
(q) => q.not().itemTypeEqualTo(ItemType.novel))
|
||||
.and()
|
||||
.isActiveEqualTo(true)
|
||||
|
|
@ -405,24 +376,25 @@ Widget _extensionUpdateTotalNumbers(WidgetRef ref, Widget widget) {
|
|||
}
|
||||
|
||||
Widget _updatesTotalNumbers(WidgetRef ref, Widget widget) {
|
||||
final hideItems = ref.watch(hideItemsStateProvider);
|
||||
return StreamBuilder(
|
||||
stream: isar.updates
|
||||
.filter()
|
||||
.idIsNotNull()
|
||||
.optional(
|
||||
ref.watch(hideMangaStateProvider),
|
||||
hideItems.contains("/MangaLibrary"),
|
||||
(q) => q.chapter(
|
||||
(c) =>
|
||||
c.manga((m) => m.not().itemTypeEqualTo(ItemType.manga)),
|
||||
))
|
||||
.optional(
|
||||
ref.watch(hideAnimeStateProvider),
|
||||
hideItems.contains("/AnimeLibrary"),
|
||||
(q) => q.chapter(
|
||||
(c) =>
|
||||
c.manga((m) => m.not().itemTypeEqualTo(ItemType.anime)),
|
||||
))
|
||||
.optional(
|
||||
ref.watch(hideNovelStateProvider),
|
||||
hideItems.contains("/NovelLibrary"),
|
||||
(q) => q.chapter(
|
||||
(c) =>
|
||||
c.manga((m) => m.not().itemTypeEqualTo(ItemType.novel)),
|
||||
|
|
|
|||
|
|
@ -32,12 +32,10 @@ class _CategoriesScreenState extends ConsumerState<CategoriesScreen>
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
int newTabs = 0;
|
||||
final hideManga = ref.watch(hideMangaStateProvider);
|
||||
final hideAnime = ref.watch(hideAnimeStateProvider);
|
||||
final hideNovel = ref.watch(hideNovelStateProvider);
|
||||
if (!hideManga) newTabs++;
|
||||
if (!hideAnime) newTabs++;
|
||||
if (!hideNovel) newTabs++;
|
||||
final hideItems = ref.watch(hideItemsStateProvider);
|
||||
if (!hideItems.contains("/MangaLibrary")) newTabs++;
|
||||
if (!hideItems.contains("/AnimeLibrary")) newTabs++;
|
||||
if (!hideItems.contains("/NovelLibrary")) newTabs++;
|
||||
if (tabs != newTabs) {
|
||||
_tabBarController.dispose();
|
||||
_tabBarController = TabController(length: newTabs, vsync: this);
|
||||
|
|
@ -62,22 +60,22 @@ class _CategoriesScreenState extends ConsumerState<CategoriesScreen>
|
|||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
controller: _tabBarController,
|
||||
tabs: [
|
||||
if (!hideManga) Tab(text: l10n.manga),
|
||||
if (!hideAnime) Tab(text: l10n.anime),
|
||||
if (!hideNovel) Tab(text: l10n.novel),
|
||||
if (!hideItems.contains("/MangaLibrary")) Tab(text: l10n.manga),
|
||||
if (!hideItems.contains("/AnimeLibrary")) Tab(text: l10n.anime),
|
||||
if (!hideItems.contains("/NovelLibrary")) Tab(text: l10n.novel),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: TabBarView(controller: _tabBarController, children: [
|
||||
if (!hideManga)
|
||||
if (!hideItems.contains("/MangaLibrary"))
|
||||
CategoriesTab(
|
||||
itemType: ItemType.manga,
|
||||
),
|
||||
if (!hideAnime)
|
||||
if (!hideItems.contains("/AnimeLibrary"))
|
||||
CategoriesTab(
|
||||
itemType: ItemType.anime,
|
||||
),
|
||||
if (!hideNovel)
|
||||
if (!hideItems.contains("/NovelLibrary"))
|
||||
CategoriesTab(
|
||||
itemType: ItemType.novel,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:mangayomi/modules/more/settings/appearance/providers/app_font_family.dart';
|
||||
import 'package:mangayomi/modules/more/settings/appearance/providers/theme_mode_state_provider.dart';
|
||||
|
|
@ -16,6 +17,16 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
|||
import 'package:mangayomi/utils/language.dart';
|
||||
import 'package:super_sliver_list/super_sliver_list.dart';
|
||||
|
||||
final navigationItems = {
|
||||
"/MangaLibrary": "Manga",
|
||||
"/AnimeLibrary": "Anime",
|
||||
"/NovelLibrary": "Novel",
|
||||
"/updates": "updates",
|
||||
"/history": "history",
|
||||
"/browse": "Browse",
|
||||
"/more": "More",
|
||||
};
|
||||
|
||||
class AppearanceScreen extends ConsumerWidget {
|
||||
const AppearanceScreen({super.key});
|
||||
|
||||
|
|
@ -28,9 +39,6 @@ class AppearanceScreen extends ConsumerWidget {
|
|||
final isDarkTheme = ref.watch(themeModeStateProvider);
|
||||
final l10nLocale = ref.watch(l10nLocaleStateProvider);
|
||||
final appFontFamily = ref.watch(appFontFamilyProvider);
|
||||
final hideAnime = ref.watch(hideAnimeStateProvider);
|
||||
final hideManga = ref.watch(hideMangaStateProvider);
|
||||
final hideNovel = ref.watch(hideNovelStateProvider);
|
||||
final appFontFamilySub = appFontFamily == null
|
||||
? context.l10n.default0
|
||||
: GoogleFonts.asMap()
|
||||
|
|
@ -300,80 +308,15 @@ class AppearanceScreen extends ConsumerWidget {
|
|||
),
|
||||
),
|
||||
ListTile(
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: Text(
|
||||
l10n.reorder_navigation,
|
||||
),
|
||||
content: SizedBox(
|
||||
width: context.width(0.8),
|
||||
child: ReorderableListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: 7,
|
||||
itemBuilder: (context, index) {
|
||||
final locale = AppLocalizations
|
||||
.supportedLocales[index];
|
||||
return RadioListTile(
|
||||
dense: true,
|
||||
contentPadding: const EdgeInsets.all(0),
|
||||
value: locale,
|
||||
groupValue: l10nLocale,
|
||||
onChanged: (value) {
|
||||
ref
|
||||
.read(l10nLocaleStateProvider
|
||||
.notifier)
|
||||
.setLocale(locale);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
title: Text(completeLanguageName(
|
||||
locale.toLanguageTag())),
|
||||
);
|
||||
},
|
||||
onReorder: (oldIndex, newIndex) {
|
||||
},
|
||||
)),
|
||||
actions: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Text(
|
||||
l10n.cancel,
|
||||
style: TextStyle(
|
||||
color: context.primaryColor),
|
||||
)),
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
});
|
||||
},
|
||||
title: Text(l10n.reorder_navigation),
|
||||
),
|
||||
SwitchListTile(
|
||||
value: hideAnime,
|
||||
title: Text(context.l10n.hide_anime),
|
||||
onChanged: (value) {
|
||||
ref.read(hideAnimeStateProvider.notifier).set(value);
|
||||
}),
|
||||
SwitchListTile(
|
||||
value: hideManga,
|
||||
title: Text(context.l10n.hide_manga),
|
||||
onChanged: (value) {
|
||||
ref.read(hideMangaStateProvider.notifier).set(value);
|
||||
}),
|
||||
SwitchListTile(
|
||||
value: hideNovel,
|
||||
title: Text(context.l10n.hide_novel),
|
||||
onChanged: (value) {
|
||||
ref.read(hideNovelStateProvider.notifier).set(value);
|
||||
}),
|
||||
onTap: () {
|
||||
context.push("/customNavigationSettings");
|
||||
},
|
||||
title: Text(l10n.reorder_navigation),
|
||||
subtitle: Text(
|
||||
l10n.reorder_navigation_description,
|
||||
style: TextStyle(
|
||||
fontSize: 11, color: context.secondaryColor),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
@ -526,3 +469,72 @@ class AppearanceScreen extends ConsumerWidget {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CustomNavigationSettings extends ConsumerStatefulWidget {
|
||||
const CustomNavigationSettings({super.key});
|
||||
|
||||
@override
|
||||
ConsumerState<CustomNavigationSettings> createState() =>
|
||||
_CustomNavigationSettingsState();
|
||||
}
|
||||
|
||||
class _CustomNavigationSettingsState
|
||||
extends ConsumerState<CustomNavigationSettings> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = l10nLocalizations(context);
|
||||
final navigationOrder = ref.watch(navigationOrderStateProvider);
|
||||
final hideItems = ref.watch(hideItemsStateProvider);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(l10n!.reorder_navigation),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: ReorderableListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: navigationOrder.length,
|
||||
itemBuilder: (context, index) {
|
||||
final navigation = navigationOrder[index];
|
||||
return SwitchListTile.adaptive(
|
||||
key: Key(navigation),
|
||||
dense: true,
|
||||
contentPadding: const EdgeInsets.only(left: 0, right: 40),
|
||||
value: hideItems.contains(navigation),
|
||||
onChanged: navigation == "/more"
|
||||
? null
|
||||
: (value) {
|
||||
final temp = hideItems.toList();
|
||||
if (value && !hideItems.contains(navigation)) {
|
||||
temp.add(navigation);
|
||||
} else {
|
||||
temp.remove(navigation);
|
||||
}
|
||||
ref.read(hideItemsStateProvider.notifier).set(temp);
|
||||
},
|
||||
title: Text(navigationItems[navigation]!),
|
||||
);
|
||||
},
|
||||
onReorder: (oldIndex, newIndex) {
|
||||
if (oldIndex < newIndex) {
|
||||
final draggedItem = navigationOrder[oldIndex];
|
||||
for (var i = oldIndex; i < newIndex - 1; i++) {
|
||||
navigationOrder[i] = navigationOrder[i + 1];
|
||||
}
|
||||
navigationOrder[newIndex - 1] = draggedItem;
|
||||
} else {
|
||||
final draggedItem = navigationOrder[oldIndex];
|
||||
for (var i = oldIndex; i > newIndex; i--) {
|
||||
navigationOrder[i] = navigationOrder[i - 1];
|
||||
}
|
||||
navigationOrder[newIndex] = draggedItem;
|
||||
}
|
||||
ref.read(navigationOrderStateProvider.notifier).set(navigationOrder);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,47 +139,41 @@ class FullScreenReaderState extends _$FullScreenReaderState {
|
|||
}
|
||||
|
||||
@riverpod
|
||||
class HideMangaState extends _$HideMangaState {
|
||||
class NavigationOrderState extends _$NavigationOrderState {
|
||||
@override
|
||||
bool build() {
|
||||
return isar.settings.getSync(227)!.hideManga ?? false;
|
||||
List<String> build() {
|
||||
return isar.settings.getSync(227)!.navigationOrder ??
|
||||
[
|
||||
'/MangaLibrary',
|
||||
'/AnimeLibrary',
|
||||
'/NovelLibrary',
|
||||
'/updates',
|
||||
'/history',
|
||||
'/browse',
|
||||
'/more'
|
||||
];
|
||||
}
|
||||
|
||||
void set(bool value) {
|
||||
void set(List<String> values) {
|
||||
final settings = isar.settings.getSync(227);
|
||||
state = value;
|
||||
state = values;
|
||||
isar.writeTxnSync(
|
||||
() => isar.settings.putSync(settings!..hideManga = value));
|
||||
() => isar.settings.putSync(settings!..navigationOrder = values));
|
||||
}
|
||||
}
|
||||
|
||||
@riverpod
|
||||
class HideAnimeState extends _$HideAnimeState {
|
||||
class HideItemsState extends _$HideItemsState {
|
||||
@override
|
||||
bool build() {
|
||||
return isar.settings.getSync(227)!.hideAnime ?? false;
|
||||
List<String> build() {
|
||||
return isar.settings.getSync(227)!.hideItems ?? [];
|
||||
}
|
||||
|
||||
void set(bool value) {
|
||||
void set(List<String> values) {
|
||||
final settings = isar.settings.getSync(227);
|
||||
state = value;
|
||||
state = values;
|
||||
isar.writeTxnSync(
|
||||
() => isar.settings.putSync(settings!..hideAnime = value));
|
||||
}
|
||||
}
|
||||
|
||||
@riverpod
|
||||
class HideNovelState extends _$HideNovelState {
|
||||
@override
|
||||
bool build() {
|
||||
return isar.settings.getSync(227)!.hideNovel ?? false;
|
||||
}
|
||||
|
||||
void set(bool value) {
|
||||
final settings = isar.settings.getSync(227);
|
||||
state = value;
|
||||
isar.writeTxnSync(
|
||||
() => isar.settings.putSync(settings!..hideNovel = value));
|
||||
() => isar.settings.putSync(settings!..hideItems = values));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -157,54 +157,39 @@ final fullScreenReaderStateProvider =
|
|||
);
|
||||
|
||||
typedef _$FullScreenReaderState = AutoDisposeNotifier<bool>;
|
||||
String _$hideMangaStateHash() => r'fd24207581798fd1634ff6df2c85b8895053d14c';
|
||||
String _$navigationOrderStateHash() =>
|
||||
r'f1da55a7687995d136a6580d3f63f9b1b32a6ae8';
|
||||
|
||||
/// See also [HideMangaState].
|
||||
@ProviderFor(HideMangaState)
|
||||
final hideMangaStateProvider =
|
||||
AutoDisposeNotifierProvider<HideMangaState, bool>.internal(
|
||||
HideMangaState.new,
|
||||
name: r'hideMangaStateProvider',
|
||||
/// See also [NavigationOrderState].
|
||||
@ProviderFor(NavigationOrderState)
|
||||
final navigationOrderStateProvider =
|
||||
AutoDisposeNotifierProvider<NavigationOrderState, List<String>>.internal(
|
||||
NavigationOrderState.new,
|
||||
name: r'navigationOrderStateProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$hideMangaStateHash,
|
||||
: _$navigationOrderStateHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$HideMangaState = AutoDisposeNotifier<bool>;
|
||||
String _$hideAnimeStateHash() => r'3e8748d9312b9ea84364959b7de17fed2204d303';
|
||||
typedef _$NavigationOrderState = AutoDisposeNotifier<List<String>>;
|
||||
String _$hideItemsStateHash() => r'b4a467e66f6a1f9b36e4b201a10b771e0dae6a80';
|
||||
|
||||
/// See also [HideAnimeState].
|
||||
@ProviderFor(HideAnimeState)
|
||||
final hideAnimeStateProvider =
|
||||
AutoDisposeNotifierProvider<HideAnimeState, bool>.internal(
|
||||
HideAnimeState.new,
|
||||
name: r'hideAnimeStateProvider',
|
||||
/// See also [HideItemsState].
|
||||
@ProviderFor(HideItemsState)
|
||||
final hideItemsStateProvider =
|
||||
AutoDisposeNotifierProvider<HideItemsState, List<String>>.internal(
|
||||
HideItemsState.new,
|
||||
name: r'hideItemsStateProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$hideAnimeStateHash,
|
||||
: _$hideItemsStateHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$HideAnimeState = AutoDisposeNotifier<bool>;
|
||||
String _$hideNovelStateHash() => r'697efab85819783a7c1982797927feb397770191';
|
||||
|
||||
/// See also [HideNovelState].
|
||||
@ProviderFor(HideNovelState)
|
||||
final hideNovelStateProvider =
|
||||
AutoDisposeNotifierProvider<HideNovelState, bool>.internal(
|
||||
HideNovelState.new,
|
||||
name: r'hideNovelStateProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$hideNovelStateHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$HideNovelState = AutoDisposeNotifier<bool>;
|
||||
typedef _$HideItemsState = AutoDisposeNotifier<List<String>>;
|
||||
String _$novelFontSizeStateHash() =>
|
||||
r'fd104e358203d3f86e14d933518f2dbd067cec13';
|
||||
|
||||
|
|
|
|||
|
|
@ -95,12 +95,10 @@ class _UpdatesScreenState extends ConsumerState<UpdatesScreen>
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
int newTabs = 0;
|
||||
final hideManga = ref.watch(hideMangaStateProvider);
|
||||
final hideAnime = ref.watch(hideAnimeStateProvider);
|
||||
final hideNovel = ref.watch(hideNovelStateProvider);
|
||||
if (!hideManga) newTabs++;
|
||||
if (!hideAnime) newTabs++;
|
||||
if (!hideNovel) newTabs++;
|
||||
final hideItems = ref.watch(hideItemsStateProvider);
|
||||
if (!hideItems.contains("/MangaLibrary")) newTabs++;
|
||||
if (!hideItems.contains("/AnimeLibrary")) newTabs++;
|
||||
if (!hideItems.contains("/NovelLibrary")) newTabs++;
|
||||
if (newTabs == 0) {
|
||||
return SizedBox.shrink();
|
||||
}
|
||||
|
|
@ -194,14 +192,17 @@ class _UpdatesScreenState extends ConsumerState<UpdatesScreen>
|
|||
.itemTypeEqualTo(_tabBarController
|
||||
.index ==
|
||||
0 &&
|
||||
!hideManga
|
||||
!hideItems.contains(
|
||||
"/MangaLibrary")
|
||||
? ItemType.manga
|
||||
: _tabBarController.index ==
|
||||
1 -
|
||||
(hideManga
|
||||
(hideItems.contains(
|
||||
"/MangaLibrary")
|
||||
? 1
|
||||
: 0) &&
|
||||
!hideAnime
|
||||
!hideItems.contains(
|
||||
"/AnimeLibrary")
|
||||
? ItemType.anime
|
||||
: ItemType.novel)))
|
||||
.findAllSync()
|
||||
|
|
@ -229,7 +230,7 @@ class _UpdatesScreenState extends ConsumerState<UpdatesScreen>
|
|||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
controller: _tabBarController,
|
||||
tabs: [
|
||||
if (!hideManga)
|
||||
if (!hideItems.contains("/MangaLibrary"))
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
|
|
@ -238,7 +239,7 @@ class _UpdatesScreenState extends ConsumerState<UpdatesScreen>
|
|||
_updateNumbers(ref, ItemType.manga)
|
||||
],
|
||||
),
|
||||
if (!hideAnime)
|
||||
if (!hideItems.contains("/AnimeLibrary"))
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
|
|
@ -247,7 +248,7 @@ class _UpdatesScreenState extends ConsumerState<UpdatesScreen>
|
|||
_updateNumbers(ref, ItemType.anime)
|
||||
],
|
||||
),
|
||||
if (!hideNovel)
|
||||
if (!hideItems.contains("/NovelLibrary"))
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
|
|
@ -262,17 +263,17 @@ class _UpdatesScreenState extends ConsumerState<UpdatesScreen>
|
|||
body: Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: TabBarView(controller: _tabBarController, children: [
|
||||
if (!hideManga)
|
||||
if (!hideItems.contains("/MangaLibrary"))
|
||||
UpdateTab(
|
||||
itemType: ItemType.manga,
|
||||
query: _textEditingController.text,
|
||||
isLoading: _isLoading),
|
||||
if (!hideAnime)
|
||||
if (!hideItems.contains("/AnimeLibrary"))
|
||||
UpdateTab(
|
||||
itemType: ItemType.anime,
|
||||
query: _textEditingController.text,
|
||||
isLoading: _isLoading),
|
||||
if (!hideNovel)
|
||||
if (!hideItems.contains("/NovelLibrary"))
|
||||
UpdateTab(
|
||||
itemType: ItemType.novel,
|
||||
query: _textEditingController.text,
|
||||
|
|
|
|||
|
|
@ -594,6 +594,19 @@ class RouterNotifier extends ChangeNotifier {
|
|||
);
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
path: "/customNavigationSettings",
|
||||
name: "customNavigationSettings",
|
||||
builder: (context, state) {
|
||||
return const CustomNavigationSettings();
|
||||
},
|
||||
pageBuilder: (context, state) {
|
||||
return transitionPage(
|
||||
key: state.pageKey,
|
||||
child: const CustomNavigationSettings(),
|
||||
);
|
||||
},
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ part of 'aniskip.dart';
|
|||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$aniSkipHash() => r'887869b54e2e151633efd46da83bde845e14f421';
|
||||
String _$aniSkipHash() => r'2e5d19b025a2207ff64da7bf7908450ea9e5ff8c';
|
||||
|
||||
/// See also [AniSkip].
|
||||
@ProviderFor(AniSkip)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ part of 'anilist.dart';
|
|||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$anilistHash() => r'70e8cd537270a9054a1ef72de117fc7ad5545218';
|
||||
String _$anilistHash() => r'ddd07acc8d28d2aa95c942566109e9393ca9e5ed';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
|
|
|
|||
Loading…
Reference in a new issue