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
50 lines
1.3 KiB
Dart
50 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:spotify/spotify.dart';
|
|
import 'package:spotube/components/shared/image/universal_image.dart';
|
|
import 'package:spotube/components/shared/links/artist_link.dart';
|
|
import 'package:spotube/extensions/image.dart';
|
|
import 'package:spotube/pages/track/track.dart';
|
|
import 'package:spotube/utils/service_utils.dart';
|
|
|
|
class StatsTrackItem extends StatelessWidget {
|
|
final Track track;
|
|
final Widget info;
|
|
const StatsTrackItem({
|
|
super.key,
|
|
required this.track,
|
|
required this.info,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ListTile(
|
|
horizontalTitleGap: 8,
|
|
leading: ClipRRect(
|
|
borderRadius: BorderRadius.circular(4),
|
|
child: UniversalImage(
|
|
path: (track.album?.images).asUrlString(
|
|
placeholder: ImagePlaceholder.albumArt,
|
|
),
|
|
width: 40,
|
|
height: 40,
|
|
),
|
|
),
|
|
title: Text(track.name!),
|
|
subtitle: ArtistLink(
|
|
artists: track.artists!,
|
|
mainAxisAlignment: WrapAlignment.start,
|
|
),
|
|
trailing: info,
|
|
onTap: () {
|
|
ServiceUtils.pushNamed(
|
|
context,
|
|
TrackPage.name,
|
|
pathParameters: {
|
|
"id": track.id!,
|
|
},
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|