mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
Compare commits
6 Commits
dd209a5171
...
b38ab70b90
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b38ab70b90 | ||
![]() |
878a441a9f | ||
![]() |
42e954428b | ||
![]() |
8c1337d1fc | ||
![]() |
94e704087f | ||
![]() |
8e287ab1e5 |
@ -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: () {},
|
||||
|
@ -71,32 +71,34 @@ class LogsPage extends HookConsumerWidget {
|
||||
),
|
||||
)
|
||||
],
|
||||
child: switch (logsQuery) {
|
||||
AsyncData(:final value) => InterScrollbar(
|
||||
controller: controller,
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: SafeArea(
|
||||
child: switch (logsQuery) {
|
||||
AsyncData(:final value) => InterScrollbar(
|
||||
controller: controller,
|
||||
child: Card(child: SelectableText(value)),
|
||||
),
|
||||
),
|
||||
AsyncError(:final error) => switch (error) {
|
||||
StateError() => Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Undraw(
|
||||
illustration: UndrawIllustration.noData,
|
||||
height: 200 * context.theme.scaling,
|
||||
width: 200 * context.theme.scaling,
|
||||
color: context.theme.colorScheme.primary,
|
||||
),
|
||||
Text(context.l10n.no_logs_found).muted().small(),
|
||||
],
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
controller: controller,
|
||||
child: Card(child: SelectableText(value)),
|
||||
),
|
||||
_ => Center(child: Text(error.toString())),
|
||||
},
|
||||
_ => const Center(child: CircularProgressIndicator()),
|
||||
},
|
||||
),
|
||||
AsyncError(:final error) => switch (error) {
|
||||
StateError() => Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Undraw(
|
||||
illustration: UndrawIllustration.noData,
|
||||
height: 200 * context.theme.scaling,
|
||||
width: 200 * context.theme.scaling,
|
||||
color: context.theme.colorScheme.primary,
|
||||
),
|
||||
Text(context.l10n.no_logs_found).muted().small(),
|
||||
],
|
||||
),
|
||||
_ => Center(child: Text(error.toString())),
|
||||
},
|
||||
_ => const Center(child: CircularProgressIndicator()),
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1221,7 +1221,7 @@ packages:
|
||||
description:
|
||||
path: "."
|
||||
ref: main
|
||||
resolved-ref: "52cd25a12c1af6a8819963d222026539e8537586"
|
||||
resolved-ref: "01935a75640092af7947bfb21a497240376f0c83"
|
||||
url: "https://github.com/KRTirtho/hetu_spotube_plugin.git"
|
||||
source: git
|
||||
version: "0.0.1"
|
||||
|
@ -56,7 +56,7 @@ dependencies:
|
||||
flutter_feather_icons: ^2.0.0+1
|
||||
flutter_form_builder: ^9.6.0
|
||||
flutter_hooks: ^0.20.5
|
||||
flutter_inappwebview: ^6.1.3
|
||||
flutter_inappwebview: ^6.1.5
|
||||
flutter_localizations:
|
||||
sdk: flutter
|
||||
flutter_native_splash: ^2.4.6
|
||||
|
Loading…
Reference in New Issue
Block a user