mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-12 23:45:18 +00:00
chore: fix adaptive select tile scrolling not working
This commit is contained in:
parent
47edb8bf96
commit
edc9636940
@ -26,8 +26,8 @@
|
||||
android:usesCleartextTraffic="true">
|
||||
<!-- Enable Impeller -->
|
||||
<!-- <meta-data
|
||||
android:name="io.flutter.embedding.android.EnableImpeller"
|
||||
android:value="true" /> -->
|
||||
android:name="io.flutter.embedding.android.EnableImpeller"
|
||||
android:value="false" /> -->
|
||||
|
||||
<activity
|
||||
android:name="com.ryanheise.audioservice.AudioServiceActivity"
|
||||
|
@ -44,7 +44,7 @@ class AdaptiveSelectTile<T> extends HookWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final mediaQuery = MediaQuery.of(context);
|
||||
final mediaQuery = MediaQuery.sizeOf(context);
|
||||
|
||||
Widget? control = Select<T>(
|
||||
itemBuilder: (context, item) {
|
||||
@ -83,24 +83,26 @@ class AdaptiveSelectTile<T> extends HookWidget {
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
content: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: options.length,
|
||||
itemBuilder: (context, index) {
|
||||
final item = options[index];
|
||||
content: Flexible(
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: options.length,
|
||||
itemBuilder: (context, index) {
|
||||
final item = options[index];
|
||||
|
||||
return ListTile(
|
||||
iconColor: theme.colorScheme.primary,
|
||||
leading: item.value == value
|
||||
? const Icon(SpotubeIcons.radioChecked)
|
||||
: const Icon(SpotubeIcons.radioUnchecked),
|
||||
title: item.child,
|
||||
onTap: () {
|
||||
onChanged?.call(item.value);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
);
|
||||
},
|
||||
return ListTile(
|
||||
iconColor: theme.colorScheme.primary,
|
||||
leading: item.value == value
|
||||
? const Icon(SpotubeIcons.radioChecked)
|
||||
: const Icon(SpotubeIcons.radioUnchecked),
|
||||
title: item.child,
|
||||
onTap: () {
|
||||
onChanged?.call(item.value);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
@ -71,10 +71,8 @@ class Sidebar extends HookConsumerWidget {
|
||||
tooltip: TooltipContainer(child: Text(tile.title)),
|
||||
child: Icon(tile.icon),
|
||||
),
|
||||
onChanged: (value) {
|
||||
if (value) {
|
||||
context.navigateTo(tile.route);
|
||||
}
|
||||
onPressed: () {
|
||||
context.navigateTo(tile.route);
|
||||
},
|
||||
),
|
||||
const NavigationDivider(),
|
||||
@ -83,10 +81,8 @@ class Sidebar extends HookConsumerWidget {
|
||||
for (final tile in sidebarLibraryTileList)
|
||||
NavigationButton(
|
||||
label: mediaQuery.lgAndUp ? Text(tile.title) : null,
|
||||
onChanged: (value) {
|
||||
if (value) {
|
||||
context.navigateTo(tile.route);
|
||||
}
|
||||
onPressed: () {
|
||||
context.navigateTo(tile.route);
|
||||
},
|
||||
child: Tooltip(
|
||||
tooltip: TooltipContainer(child: Text(tile.title)),
|
||||
|
@ -61,20 +61,20 @@ class SpotubeNavigationBar extends HookConsumerWidget {
|
||||
index: selectedIndex,
|
||||
surfaceBlur: context.theme.surfaceBlur,
|
||||
surfaceOpacity: context.theme.surfaceOpacity,
|
||||
onSelected: (i) {
|
||||
context.navigateTo(navbarTileList[i].route);
|
||||
},
|
||||
children: [
|
||||
for (final tile in navbarTileList)
|
||||
NavigationButton(
|
||||
style: const ButtonStyle.muted(density: ButtonDensity.icon),
|
||||
selectedStyle:
|
||||
const ButtonStyle.fixed(density: ButtonDensity.icon),
|
||||
style: navbarTileList[selectedIndex] == tile
|
||||
? const ButtonStyle.fixed(density: ButtonDensity.icon)
|
||||
: const ButtonStyle.muted(density: ButtonDensity.icon),
|
||||
child: Badge(
|
||||
isLabelVisible: tile.id == "library" && downloadCount > 0,
|
||||
label: Text(downloadCount.toString()),
|
||||
child: Icon(tile.icon),
|
||||
),
|
||||
onPressed: () {
|
||||
context.navigateTo(tile.route);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
|
@ -63,18 +63,18 @@ class StatsPageTopSection extends HookConsumerWidget {
|
||||
children: [
|
||||
TabList(
|
||||
index: selectedIndex.value,
|
||||
onChanged: (value) {
|
||||
selectedIndex.value = value;
|
||||
},
|
||||
children: [
|
||||
TabButton(
|
||||
TabItem(
|
||||
child: Text(context.l10n.top_tracks),
|
||||
onPressed: () => selectedIndex.value = 0,
|
||||
),
|
||||
TabButton(
|
||||
TabItem(
|
||||
child: Text(context.l10n.top_artists),
|
||||
onPressed: () => selectedIndex.value = 1,
|
||||
),
|
||||
TabButton(
|
||||
TabItem(
|
||||
child: Text(context.l10n.top_albums),
|
||||
onPressed: () => selectedIndex.value = 2,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -53,18 +53,18 @@ class LibraryPage extends HookConsumerWidget {
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: TabList(
|
||||
index: index,
|
||||
onChanged: (index) {
|
||||
context.navigateTo(sidebarLibraryTileList[index].route);
|
||||
},
|
||||
children: [
|
||||
for (final tile in sidebarLibraryTileList)
|
||||
TabButton(
|
||||
TabItem(
|
||||
child: Badge(
|
||||
isLabelVisible: tile.id == 'downloads' &&
|
||||
downloadingCount > 0,
|
||||
label: Text(downloadingCount.toString()),
|
||||
child: Text(tile.title),
|
||||
),
|
||||
onPressed: () {
|
||||
context.navigateTo(tile.route);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -41,13 +41,12 @@ class LyricsPage extends HookConsumerWidget {
|
||||
child: isModal
|
||||
? TabList(
|
||||
index: selectedIndex.value,
|
||||
onChanged: (index) => selectedIndex.value = index,
|
||||
children: [
|
||||
TabButton(
|
||||
onPressed: () => selectedIndex.value = 0,
|
||||
TabItem(
|
||||
child: Text(context.l10n.synced),
|
||||
),
|
||||
TabButton(
|
||||
onPressed: () => selectedIndex.value = 1,
|
||||
TabItem(
|
||||
child: Text(context.l10n.plain),
|
||||
),
|
||||
],
|
||||
@ -55,9 +54,9 @@ class LyricsPage extends HookConsumerWidget {
|
||||
: Tabs(
|
||||
index: selectedIndex.value,
|
||||
onChanged: (index) => selectedIndex.value = index,
|
||||
tabs: [
|
||||
Text(context.l10n.synced),
|
||||
Text(context.l10n.plain),
|
||||
children: [
|
||||
TabItem(child: Text(context.l10n.synced)),
|
||||
TabItem(child: Text(context.l10n.plain)),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
@ -81,9 +81,9 @@ class MiniLyricsPage extends HookConsumerWidget {
|
||||
onChanged: (i) {
|
||||
index.value = i;
|
||||
},
|
||||
tabs: [
|
||||
Text(context.l10n.synced),
|
||||
Text(context.l10n.plain),
|
||||
children: [
|
||||
TabItem(child: Text(context.l10n.synced)),
|
||||
TabItem(child: Text(context.l10n.plain)),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
|
13
pubspec.lock
13
pubspec.lock
@ -2011,12 +2011,11 @@ packages:
|
||||
shadcn_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "."
|
||||
ref: d928e73cd734582046c63a3bed99cc42aeab6085
|
||||
resolved-ref: d928e73cd734582046c63a3bed99cc42aeab6085
|
||||
url: "https://github.com/KRTirtho/shadcn_flutter.git"
|
||||
source: git
|
||||
version: "0.0.24"
|
||||
name: shadcn_flutter
|
||||
sha256: a04b6ce51ff8486fe9c0c3b373605ab30b823507a79a4458fc74b056edc883d8
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.0.25"
|
||||
shared_preferences:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -2754,4 +2753,4 @@ packages:
|
||||
version: "1.0.0"
|
||||
sdks:
|
||||
dart: ">=3.7.0-0 <4.0.0"
|
||||
flutter: ">=3.27.0"
|
||||
flutter: ">=3.29.0"
|
||||
|
@ -104,10 +104,7 @@ dependencies:
|
||||
ref: dart-3-support
|
||||
url: https://github.com/KRTirtho/scrobblenaut.git
|
||||
scroll_to_index: ^3.0.1
|
||||
shadcn_flutter:
|
||||
git:
|
||||
url: https://github.com/KRTirtho/shadcn_flutter.git
|
||||
ref: d928e73cd734582046c63a3bed99cc42aeab6085
|
||||
shadcn_flutter: ^0.0.25
|
||||
shared_preferences: ^2.2.3
|
||||
shelf: ^1.4.1
|
||||
shelf_router: ^1.1.4
|
||||
|
Loading…
Reference in New Issue
Block a user