修复一下

This commit is contained in:
rang 2025-10-25 17:22:39 +08:00
parent 41ade02ace
commit debba61cad
4 changed files with 16 additions and 27 deletions

View file

@ -116,8 +116,7 @@ class ScaffoldWithNavBar extends HookConsumerWidget {
// extended: false,
destinations: _navigationItems(context).map((item) {
final isDestinationLibrary = item.name == S.of(context).library;
var currentLibrary =
ref.watch(currentLibraryProvider).valueOrNull;
var currentLibrary = ref.watch(currentLibraryProvider).valueOrNull;
final libraryIcon = AbsIcons.getIconByName(
currentLibrary?.icon,
);
@ -126,13 +125,9 @@ class ScaffoldWithNavBar extends HookConsumerWidget {
isDestinationLibrary ? libraryIcon ?? item.icon : item.icon,
),
selectedIcon: Icon(
isDestinationLibrary
? libraryIcon ?? item.activeIcon
: item.activeIcon,
isDestinationLibrary ? libraryIcon ?? item.activeIcon : item.activeIcon,
),
label: Text(isDestinationLibrary
? currentLibrary?.name ?? item.name
: item.name),
label: Text(isDestinationLibrary ? currentLibrary?.name ?? item.name : item.name),
// tooltip: item.tooltip,
);
// if (isDestinationLibrary) {
@ -171,8 +166,8 @@ class ScaffoldWithNavBar extends HookConsumerWidget {
// useValueListenable(ref.watch(playerExpandProgressNotifierProvider));
final playerProgress = ref.watch(playerHeightProvider);
final playerMaxHeight = MediaQuery.of(context).size.height;
var percentExpandedMiniPlayer = (playerProgress - playerMinHeight) /
(playerMaxHeight - playerMinHeight);
var percentExpandedMiniPlayer =
(playerProgress - playerMinHeight) / (playerMaxHeight - playerMinHeight);
// Clamp the value between 0 and 1
percentExpandedMiniPlayer = percentExpandedMiniPlayer.clamp(0.0, 1.0);
return Opacity(
@ -198,13 +193,9 @@ class ScaffoldWithNavBar extends HookConsumerWidget {
isDestinationLibrary ? libraryIcon ?? item.icon : item.icon,
),
selectedIcon: Icon(
isDestinationLibrary
? libraryIcon ?? item.activeIcon
: item.activeIcon,
isDestinationLibrary ? libraryIcon ?? item.activeIcon : item.activeIcon,
),
label: isDestinationLibrary
? currentLibrary?.name ?? item.name
: item.name,
label: isDestinationLibrary ? currentLibrary?.name ?? item.name : item.name,
tooltip: item.tooltip,
);
if (isDestinationLibrary) {
@ -239,7 +230,7 @@ class ScaffoldWithNavBar extends HookConsumerWidget {
icon: Icons.book_outlined,
activeIcon: Icons.book,
// tooltip: 'Browse your library',
tooltip: S.of(context).exploreTooltip,
tooltip: S.of(context).libraryTooltip,
),
_NavigationItem(
// name: 'Explore',