mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-12-08 16:27:31 +00:00
feat: add text to explain user how hypothetical fees are calculated
This commit is contained in:
parent
fd4b8a3bbc
commit
cefda904de
@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
import 'package:sliver_tools/sliver_tools.dart';
|
||||||
import 'package:spotube/collections/formatters.dart';
|
import 'package:spotube/collections/formatters.dart';
|
||||||
import 'package:spotube/components/shared/page_window_title_bar.dart';
|
import 'package:spotube/components/shared/page_window_title_bar.dart';
|
||||||
import 'package:spotube/components/stats/common/artist_item.dart';
|
import 'package:spotube/components/stats/common/artist_item.dart';
|
||||||
@ -13,6 +14,8 @@ class StatsStreamFeesPage extends HookConsumerWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, ref) {
|
Widget build(BuildContext context, ref) {
|
||||||
|
final ThemeData(:textTheme, :hintColor) = Theme.of(context);
|
||||||
|
|
||||||
final artists = ref.watch(
|
final artists = ref.watch(
|
||||||
playbackHistoryTopProvider(HistoryDuration.days30)
|
playbackHistoryTopProvider(HistoryDuration.days30)
|
||||||
.select((value) => value.artists),
|
.select((value) => value.artists),
|
||||||
@ -24,15 +27,38 @@ class StatsStreamFeesPage extends HookConsumerWidget {
|
|||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
title: Text("Streaming fees (hypothetical)"),
|
title: Text("Streaming fees (hypothetical)"),
|
||||||
),
|
),
|
||||||
body: ListView.builder(
|
body: CustomScrollView(
|
||||||
itemCount: artists.length,
|
slivers: [
|
||||||
itemBuilder: (context, index) {
|
SliverCrossAxisConstrained(
|
||||||
final artist = artists[index];
|
maxCrossAxisExtent: 600,
|
||||||
return StatsArtistItem(
|
alignment: -1,
|
||||||
artist: artist.artist,
|
child: SliverPadding(
|
||||||
info: Text(usdFormatter.format(artist.count * 0.005)),
|
padding: const EdgeInsets.all(16.0),
|
||||||
);
|
sliver: SliverToBoxAdapter(
|
||||||
},
|
child: Text(
|
||||||
|
"*This is calculated based on Spotify's per stream "
|
||||||
|
"payout of \$0.003 to \$0.005. This is a hypothetical "
|
||||||
|
"calculation to give user insight about how much they "
|
||||||
|
"would have paid to the artists if they were to listen "
|
||||||
|
"their song in Spotify.",
|
||||||
|
style: textTheme.bodySmall?.copyWith(
|
||||||
|
color: hintColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SliverList.builder(
|
||||||
|
itemCount: artists.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final artist = artists[index];
|
||||||
|
return StatsArtistItem(
|
||||||
|
artist: artist.artist,
|
||||||
|
info: Text(usdFormatter.format(artist.count * 0.005)),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user