mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00

* feat: add playback history provider * feat: implement recently played section * refactor: use route names * feat: add stats summary and top tracks/artists/albums * feat: add top date based filtering * feat: add stream money calculation * refactor: place search in mobile navbar and settings in home appbar * feat: add individual minutes and streams page * feat(stats): add individual minutes and streams page * chore: default period to 1 month * feat: add text to explain user how hypothetical fees are calculated * chore: ensure usage of route names instead of direct paths * cd: add cache key * cd: remove media_kit_event_loop from git
30 lines
926 B
Dart
30 lines
926 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:spotube/collections/formatters.dart';
|
|
import 'package:spotube/components/stats/common/album_item.dart';
|
|
import 'package:spotube/provider/history/top.dart';
|
|
|
|
class TopAlbums extends HookConsumerWidget {
|
|
const TopAlbums({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context, ref) {
|
|
final historyDuration = ref.watch(playbackHistoryTopDurationProvider);
|
|
final albums = ref.watch(playbackHistoryTopProvider(historyDuration)
|
|
.select((value) => value.albums));
|
|
|
|
return SliverList.builder(
|
|
itemCount: albums.length,
|
|
itemBuilder: (context, index) {
|
|
final album = albums[index];
|
|
return StatsAlbumItem(
|
|
album: album.album,
|
|
info: Text(
|
|
"${compactNumberFormatter.format(album.count)} plays",
|
|
),
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|