mirror of
https://github.com/KRTirtho/spotube.git
synced 2026-06-21 02:18:03 +00:00
Compare commits
1 Commits
be5d2dddcb
...
fdb1ee8578
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fdb1ee8578 |
1910
CHANGELOG.md
1910
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@ -33,8 +33,7 @@ extension SpotubeImageExtensions on List<SpotubeImageObject>? {
|
|||||||
int index = 1,
|
int index = 1,
|
||||||
required ImagePlaceholder placeholder,
|
required ImagePlaceholder placeholder,
|
||||||
}) {
|
}) {
|
||||||
final sortedImage =
|
final sortedImage = this?.sorted((a, b) => (a.width ?? 0).compareTo(b.width ?? 0));
|
||||||
this?.sorted((a, b) => (a.width ?? 0).compareTo(b.width ?? 0));
|
|
||||||
|
|
||||||
return sortedImage != null && sortedImage.isNotEmpty
|
return sortedImage != null && sortedImage.isNotEmpty
|
||||||
? sortedImage[
|
? sortedImage[
|
||||||
|
|||||||
@ -59,7 +59,6 @@ class SearchPage extends HookConsumerWidget {
|
|||||||
|
|
||||||
void onSubmitted(String value) {
|
void onSubmitted(String value) {
|
||||||
ref.read(searchTermStateProvider.notifier).state = value;
|
ref.read(searchTermStateProvider.notifier).state = value;
|
||||||
focusNode.unfocus();
|
|
||||||
if (value.trim().isEmpty) {
|
if (value.trim().isEmpty) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -128,47 +127,61 @@ class SearchPage extends HookConsumerWidget {
|
|||||||
)
|
)
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
return AutoComplete(
|
return KeyboardListener(
|
||||||
suggestions: suggestions.length <= 2
|
focusNode: focusNode,
|
||||||
? [
|
autofocus: true,
|
||||||
...suggestions,
|
onKeyEvent: (value) {
|
||||||
"Twenty One Pilots",
|
final isEnter = value.logicalKey ==
|
||||||
"Linkin Park",
|
LogicalKeyboardKey.enter;
|
||||||
]
|
|
||||||
: suggestions,
|
if (isEnter) {
|
||||||
completer: (suggestion) => suggestion,
|
onSubmitted(controller.text);
|
||||||
mode: AutoCompleteMode.replaceAll,
|
focusNode.unfocus();
|
||||||
child: TextField(
|
}
|
||||||
autofocus: true,
|
},
|
||||||
controller: controller,
|
child: AutoComplete(
|
||||||
focusNode: focusNode,
|
suggestions: suggestions.length <= 2
|
||||||
features: [
|
? [
|
||||||
const InputFeature.leading(
|
...suggestions,
|
||||||
Icon(SpotubeIcons.search),
|
"Twenty One Pilots",
|
||||||
),
|
"Linkin Park",
|
||||||
InputFeature.trailing(
|
"d4vd"
|
||||||
AnimatedCrossFade(
|
]
|
||||||
duration:
|
: suggestions,
|
||||||
const Duration(milliseconds: 300),
|
completer: (suggestion) => suggestion,
|
||||||
crossFadeState:
|
mode: AutoCompleteMode.replaceAll,
|
||||||
controller.text.isNotEmpty
|
child: TextField(
|
||||||
? CrossFadeState.showFirst
|
autofocus: true,
|
||||||
: CrossFadeState.showSecond,
|
controller: controller,
|
||||||
firstChild: IconButton.ghost(
|
features: [
|
||||||
size: ButtonSize.small,
|
const InputFeature.leading(
|
||||||
icon: const Icon(SpotubeIcons.close),
|
Icon(SpotubeIcons.search),
|
||||||
onPressed: () {
|
|
||||||
controller.clear();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
secondChild: const SizedBox.square(
|
|
||||||
dimension: 28),
|
|
||||||
),
|
),
|
||||||
)
|
InputFeature.trailing(
|
||||||
],
|
AnimatedCrossFade(
|
||||||
textInputAction: TextInputAction.search,
|
duration:
|
||||||
placeholder: Text(context.l10n.search),
|
const Duration(milliseconds: 300),
|
||||||
onSubmitted: onSubmitted,
|
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),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
textInputAction: TextInputAction.search,
|
||||||
|
placeholder: Text(context.l10n.search),
|
||||||
|
onSubmitted: onSubmitted,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
|||||||
12
pubspec.lock
12
pubspec.lock
@ -2376,26 +2376,26 @@ packages:
|
|||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: test
|
name: test
|
||||||
sha256: "75906bf273541b676716d1ca7627a17e4c4070a3a16272b7a3dc7da3b9f3f6b7"
|
sha256: "65e29d831719be0591f7b3b1a32a3cda258ec98c58c7b25f7b84241bc31215bb"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.26.3"
|
version: "1.26.2"
|
||||||
test_api:
|
test_api:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
|
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.7"
|
version: "0.7.6"
|
||||||
test_core:
|
test_core:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_core
|
name: test_core
|
||||||
sha256: "0cc24b5ff94b38d2ae73e1eb43cc302b77964fbf67abad1e296025b78deb53d0"
|
sha256: "80bf5a02b60af04b09e14f6fe68b921aad119493e26e490deaca5993fef1b05a"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.12"
|
version: "0.6.11"
|
||||||
time:
|
time:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@ -3,7 +3,7 @@ description: Open source extensible music streaming platform and app, based on B
|
|||||||
|
|
||||||
publish_to: "none"
|
publish_to: "none"
|
||||||
|
|
||||||
version: 5.1.2+45
|
version: 5.1.1+44
|
||||||
|
|
||||||
homepage: https://spotube.krtirtho.dev
|
homepage: https://spotube.krtirtho.dev
|
||||||
repository: https://github.com/KRTirtho/spotube
|
repository: https://github.com/KRTirtho/spotube
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user