fix: user cover art instead of artist image url

This commit is contained in:
Matyáš Caras 2024-05-27 21:46:54 +02:00
parent a5233a33da
commit 648cbf97a7
Signed by: hernik
GPG key ID: 2A3175F98820C5C6
4 changed files with 12 additions and 3 deletions

View file

@ -1,4 +1,5 @@
import 'package:json_annotation/json_annotation.dart'; import 'package:json_annotation/json_annotation.dart';
import 'package:ocarina/api/subsonic/subsonic.dart';
part 'artist.g.dart'; part 'artist.g.dart';
@JsonSerializable() @JsonSerializable()
@ -34,4 +35,7 @@ class Artist {
/// Artist image URL /// Artist image URL
final String artistImageUrl; final String artistImageUrl;
/// Returns the cover art URL formed from the [coverArtId]
String get coverArt => SubsonicApiService().getCoverArtUrl(coverArtId);
} }

View file

@ -45,7 +45,7 @@ class _ArtistViewState extends State<ArtistView> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
HeroBanner( HeroBanner(
imageUrl: widget.artist.artistImageUrl, imageUrl: widget.artist.coverArt,
title: widget.artist.name, title: widget.artist.name,
description: "This could be a cool description soon", description: "This could be a cool description soon",
heroTag: widget.artist.name, heroTag: widget.artist.name,

View file

@ -116,7 +116,7 @@ class _HomeViewState extends State<HomeView> {
); );
}, },
child: ImageCover( child: ImageCover(
imageUrl: index.artists[n].artistImageUrl, imageUrl: index.artists[n].coverArt,
title: index.artists[n].name, title: index.artists[n].name,
heroTag: index.artists[n].name, heroTag: index.artists[n].name,
), ),

View file

@ -1,7 +1,9 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:responsive_sizer/responsive_sizer.dart'; import 'package:responsive_sizer/responsive_sizer.dart';
import 'package:shimmer/shimmer.dart'; import 'package:shimmer/shimmer.dart';
import 'package:text_scroll/text_scroll.dart';
class HeroBanner extends StatelessWidget { class HeroBanner extends StatelessWidget {
const HeroBanner({ const HeroBanner({
@ -60,7 +62,10 @@ class HeroBanner extends StatelessWidget {
const SizedBox( const SizedBox(
height: 5, height: 5,
), ),
Text(description), AutoSizeText(
description,
overflowReplacement: TextScroll(description),
),
], ],
), ),
], ],