mirror of
https://github.com/KRTirtho/spotube.git
synced 2026-02-04 07:52:55 +00:00
fix: hide followers count when null instead of showing Infinity
The MusicBrainz metadata plugin doesn't provide follower counts, so artist.followers is always null. Previously this caused "Infinity Followers" to be displayed. Now the followers line is hidden when the data is unavailable.
This commit is contained in:
parent
826c8e4dd6
commit
c2039d14fd
@ -192,20 +192,19 @@ class ArtistPageHeader extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Gap(5),
|
const Gap(5),
|
||||||
Flexible(
|
if (artist.followers != null)
|
||||||
child: AutoSizeText(
|
Flexible(
|
||||||
context.l10n.followers(
|
child: AutoSizeText(
|
||||||
artist.followers == null
|
context.l10n.followers(
|
||||||
? double.infinity
|
PrimitiveUtils.toReadableNumber(
|
||||||
: PrimitiveUtils.toReadableNumber(
|
artist.followers!.toDouble(),
|
||||||
artist.followers!.toDouble(),
|
),
|
||||||
),
|
),
|
||||||
),
|
maxLines: 1,
|
||||||
maxLines: 1,
|
overflow: TextOverflow.ellipsis,
|
||||||
overflow: TextOverflow.ellipsis,
|
minFontSize: 12,
|
||||||
minFontSize: 12,
|
).muted(),
|
||||||
).muted(),
|
),
|
||||||
),
|
|
||||||
if (constrains.mdAndUp) ...[
|
if (constrains.mdAndUp) ...[
|
||||||
const Gap(20),
|
const Gap(20),
|
||||||
actions,
|
actions,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user