mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-17 17:35:16 +00:00
Compare commits
1 Commits
cfcb729ff2
...
3539b6f38b
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3539b6f38b |
@ -70,7 +70,6 @@ class SiblingTracksSheet extends HookConsumerWidget {
|
||||
final preferences = ref.watch(userPreferencesProvider);
|
||||
final youtubeEngine = ref.watch(youtubeEngineProvider);
|
||||
|
||||
final isLoading = useState(false);
|
||||
final isSearching = useState(false);
|
||||
final searchMode = useState(preferences.searchMode);
|
||||
final activeTrackSources = ref.watch(activeTrackSourcesProvider);
|
||||
@ -196,40 +195,27 @@ class SiblingTracksSheet extends HookConsumerWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
enabled: !isFetchingActiveTrack && !isLoading.value,
|
||||
enabled: !isFetchingActiveTrack,
|
||||
selected: !isFetchingActiveTrack &&
|
||||
sourceInfo.id == activeTrackSource?.info.id,
|
||||
onPressed: () async {
|
||||
if (!isFetchingActiveTrack &&
|
||||
sourceInfo.id != activeTrackSource?.info.id) {
|
||||
try {
|
||||
isLoading.value = true;
|
||||
await activeTrackNotifier?.swapWithSibling(sourceInfo);
|
||||
await ref.read(audioPlayerProvider.notifier).swapActiveSource();
|
||||
await activeTrackNotifier?.swapWithSibling(sourceInfo);
|
||||
await ref.read(audioPlayerProvider.notifier).swapActiveSource();
|
||||
|
||||
if (context.mounted) {
|
||||
if (MediaQuery.sizeOf(context).mdAndUp) {
|
||||
closeOverlay(context);
|
||||
} else {
|
||||
closeDrawer(context);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
if (context.mounted) {
|
||||
isLoading.value = false;
|
||||
if (context.mounted) {
|
||||
if (MediaQuery.sizeOf(context).mdAndUp) {
|
||||
closeOverlay(context);
|
||||
} else {
|
||||
closeDrawer(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
[
|
||||
activeTrackSource,
|
||||
activeTrackNotifier,
|
||||
siblings,
|
||||
isFetchingActiveTrack,
|
||||
isLoading.value,
|
||||
],
|
||||
[activeTrackSource, activeTrackNotifier, siblings],
|
||||
);
|
||||
|
||||
final scale = context.theme.scaling;
|
||||
@ -307,15 +293,6 @@ class SiblingTracksSheet extends HookConsumerWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
child: isLoading.value
|
||||
? const SizedBox(
|
||||
width: double.infinity,
|
||||
child: LinearProgressIndicator(),
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
Expanded(
|
||||
child: AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
@ -330,9 +307,7 @@ class SiblingTracksSheet extends HookConsumerWidget {
|
||||
itemCount: siblings.length,
|
||||
separatorBuilder: (context, index) => const Gap(8),
|
||||
itemBuilder: (context, index) => itemBuilder(
|
||||
siblings[index],
|
||||
activeTrackSource!.source,
|
||||
),
|
||||
siblings[index], activeTrackSource!.source),
|
||||
),
|
||||
true => FutureBuilder(
|
||||
future: searchRequest,
|
||||
|
@ -13,6 +13,7 @@ import 'package:spotube/l10n/l10n.dart';
|
||||
import 'package:spotube/provider/user_preferences/user_preferences_provider.dart';
|
||||
|
||||
final localWithName = L10n.all.map((e) {
|
||||
print(e);
|
||||
final isoCodeName =
|
||||
LanguageLocals.getDisplayLanguage(e.languageCode, e.countryCode);
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user