mirror of
https://github.com/KRTirtho/spotube.git
synced 2026-06-20 18:08:04 +00:00
Compare commits
7 Commits
4f9b3e115b
...
03a595b3a7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03a595b3a7 | ||
|
|
80626ba4b5 | ||
|
|
b9b59835d9 | ||
|
|
33e1f3bef5 | ||
|
|
e1149537b1 | ||
|
|
2cc8d2620d | ||
|
|
42e954428b |
1910
CHANGELOG.md
1910
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@ -33,7 +33,8 @@ extension SpotubeImageExtensions on List<SpotubeImageObject>? {
|
||||
int index = 1,
|
||||
required ImagePlaceholder placeholder,
|
||||
}) {
|
||||
final sortedImage = this?.sorted((a, b) => (a.width ?? 0).compareTo(b.width ?? 0));
|
||||
final sortedImage =
|
||||
this?.sorted((a, b) => (a.width ?? 0).compareTo(b.width ?? 0));
|
||||
|
||||
return sortedImage != null && sortedImage.isNotEmpty
|
||||
? sortedImage[
|
||||
|
||||
@ -9,7 +9,7 @@ import 'package:spotube/provider/history/recent.dart';
|
||||
|
||||
class HomeRecentlyPlayedSection extends HookConsumerWidget {
|
||||
const HomeRecentlyPlayedSection({super.key});
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, ref) {
|
||||
final history = ref.watch(recentlyPlayedItems);
|
||||
@ -20,17 +20,20 @@ class HomeRecentlyPlayedSection extends HookConsumerWidget {
|
||||
return const SizedBox();
|
||||
}
|
||||
|
||||
final uniqueItems = <dynamic>{};
|
||||
final filteredItems = [
|
||||
for (final item in historyData)
|
||||
if (item.playlist != null && item.playlist?.id != null && uniqueItems.add(item.playlist!.id!))
|
||||
item.playlist
|
||||
else if (item.album != null && item.album?.id != null && uniqueItems.add(item.album?.id))
|
||||
item.album
|
||||
];
|
||||
|
||||
return Skeletonizer(
|
||||
enabled: history.isLoading,
|
||||
child: HorizontalPlaybuttonCardView(
|
||||
title: Text(context.l10n.recently_played),
|
||||
items: [
|
||||
for (final item in historyData)
|
||||
if (item.playlist != null)
|
||||
item.playlist
|
||||
else if (item.album != null)
|
||||
item.album
|
||||
],
|
||||
items: filteredItems,
|
||||
hasNextPage: false,
|
||||
isLoadingNextPage: false,
|
||||
onFetchMore: () {},
|
||||
|
||||
@ -59,6 +59,7 @@ class SearchPage extends HookConsumerWidget {
|
||||
|
||||
void onSubmitted(String value) {
|
||||
ref.read(searchTermStateProvider.notifier).state = value;
|
||||
focusNode.unfocus();
|
||||
if (value.trim().isEmpty) {
|
||||
return;
|
||||
}
|
||||
@ -127,61 +128,47 @@ class SearchPage extends HookConsumerWidget {
|
||||
)
|
||||
.toList();
|
||||
|
||||
return KeyboardListener(
|
||||
focusNode: focusNode,
|
||||
autofocus: true,
|
||||
onKeyEvent: (value) {
|
||||
final isEnter = value.logicalKey ==
|
||||
LogicalKeyboardKey.enter;
|
||||
|
||||
if (isEnter) {
|
||||
onSubmitted(controller.text);
|
||||
focusNode.unfocus();
|
||||
}
|
||||
},
|
||||
child: AutoComplete(
|
||||
suggestions: suggestions.length <= 2
|
||||
? [
|
||||
...suggestions,
|
||||
"Twenty One Pilots",
|
||||
"Linkin Park",
|
||||
"d4vd"
|
||||
]
|
||||
: suggestions,
|
||||
completer: (suggestion) => suggestion,
|
||||
mode: AutoCompleteMode.replaceAll,
|
||||
child: TextField(
|
||||
autofocus: true,
|
||||
controller: controller,
|
||||
features: [
|
||||
const InputFeature.leading(
|
||||
Icon(SpotubeIcons.search),
|
||||
),
|
||||
InputFeature.trailing(
|
||||
AnimatedCrossFade(
|
||||
duration:
|
||||
const Duration(milliseconds: 300),
|
||||
crossFadeState:
|
||||
controller.text.isNotEmpty
|
||||
? CrossFadeState.showFirst
|
||||
: CrossFadeState.showSecond,
|
||||
firstChild: IconButton.ghost(
|
||||
size: ButtonSize.small,
|
||||
icon:
|
||||
const Icon(SpotubeIcons.close),
|
||||
onPressed: () {
|
||||
controller.clear();
|
||||
},
|
||||
),
|
||||
secondChild: const SizedBox.square(
|
||||
dimension: 28),
|
||||
return AutoComplete(
|
||||
suggestions: suggestions.length <= 2
|
||||
? [
|
||||
...suggestions,
|
||||
"Twenty One Pilots",
|
||||
"Linkin Park",
|
||||
]
|
||||
: suggestions,
|
||||
completer: (suggestion) => suggestion,
|
||||
mode: AutoCompleteMode.replaceAll,
|
||||
child: TextField(
|
||||
autofocus: true,
|
||||
controller: controller,
|
||||
focusNode: focusNode,
|
||||
features: [
|
||||
const InputFeature.leading(
|
||||
Icon(SpotubeIcons.search),
|
||||
),
|
||||
InputFeature.trailing(
|
||||
AnimatedCrossFade(
|
||||
duration:
|
||||
const Duration(milliseconds: 300),
|
||||
crossFadeState:
|
||||
controller.text.isNotEmpty
|
||||
? CrossFadeState.showFirst
|
||||
: CrossFadeState.showSecond,
|
||||
firstChild: IconButton.ghost(
|
||||
size: ButtonSize.small,
|
||||
icon: const Icon(SpotubeIcons.close),
|
||||
onPressed: () {
|
||||
controller.clear();
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
textInputAction: TextInputAction.search,
|
||||
placeholder: Text(context.l10n.search),
|
||||
onSubmitted: onSubmitted,
|
||||
),
|
||||
secondChild: const SizedBox.square(
|
||||
dimension: 28),
|
||||
),
|
||||
)
|
||||
],
|
||||
textInputAction: TextInputAction.search,
|
||||
placeholder: Text(context.l10n.search),
|
||||
onSubmitted: onSubmitted,
|
||||
),
|
||||
);
|
||||
}),
|
||||
|
||||
12
pubspec.lock
12
pubspec.lock
@ -2376,26 +2376,26 @@ packages:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: test
|
||||
sha256: "65e29d831719be0591f7b3b1a32a3cda258ec98c58c7b25f7b84241bc31215bb"
|
||||
sha256: "75906bf273541b676716d1ca7627a17e4c4070a3a16272b7a3dc7da3b9f3f6b7"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.26.2"
|
||||
version: "1.26.3"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
|
||||
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.6"
|
||||
version: "0.7.7"
|
||||
test_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_core
|
||||
sha256: "80bf5a02b60af04b09e14f6fe68b921aad119493e26e490deaca5993fef1b05a"
|
||||
sha256: "0cc24b5ff94b38d2ae73e1eb43cc302b77964fbf67abad1e296025b78deb53d0"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.11"
|
||||
version: "0.6.12"
|
||||
time:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@ -3,7 +3,7 @@ description: Open source extensible music streaming platform and app, based on B
|
||||
|
||||
publish_to: "none"
|
||||
|
||||
version: 5.1.1+44
|
||||
version: 5.1.2+45
|
||||
|
||||
homepage: https://spotube.krtirtho.dev
|
||||
repository: https://github.com/KRTirtho/spotube
|
||||
|
||||
Loading…
Reference in New Issue
Block a user