mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-30 05:12:00 +02:00
feat(artists): show provider-neutral upcoming concerts
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:spotiflac_android/l10n/l10n.dart';
|
||||
import 'package:spotiflac_android/models/artist_concert.dart';
|
||||
import 'package:spotiflac_android/screens/artist_concerts_screen.dart';
|
||||
import 'package:spotiflac_android/widgets/animation_utils.dart';
|
||||
|
||||
class ArtistConcertsButton extends StatelessWidget {
|
||||
const ArtistConcertsButton({
|
||||
super.key,
|
||||
required this.artistName,
|
||||
required this.concerts,
|
||||
this.coverUrl,
|
||||
});
|
||||
|
||||
final String artistName;
|
||||
final List<ArtistConcert> concerts;
|
||||
final String? coverUrl;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (concerts.isEmpty) return const SizedBox.shrink();
|
||||
return TextButton.icon(
|
||||
onPressed: () => Navigator.of(context).push(
|
||||
slidePageRoute<void>(
|
||||
page: ArtistConcertsScreen(
|
||||
artistName: artistName,
|
||||
concerts: concerts,
|
||||
coverUrl: coverUrl,
|
||||
),
|
||||
),
|
||||
),
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: Colors.white,
|
||||
backgroundColor: Colors.black.withValues(alpha: 0.35),
|
||||
minimumSize: const Size(0, 36),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(9),
|
||||
side: BorderSide(color: Colors.white.withValues(alpha: 0.22)),
|
||||
),
|
||||
textStyle: const TextStyle(fontSize: 13, fontWeight: FontWeight.w600),
|
||||
),
|
||||
icon: const Icon(Icons.confirmation_number_rounded, size: 16),
|
||||
label: Text(
|
||||
context.l10n.artistUpcomingConcerts,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -146,6 +146,7 @@ class MornyeArtistHeader extends StatelessWidget {
|
||||
required this.showTitle,
|
||||
this.listeners,
|
||||
this.logoUrl,
|
||||
this.badge,
|
||||
});
|
||||
|
||||
final String name;
|
||||
@@ -154,6 +155,7 @@ class MornyeArtistHeader extends StatelessWidget {
|
||||
final bool showTitle;
|
||||
final String? listeners;
|
||||
final String? logoUrl;
|
||||
final Widget? badge;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) =>
|
||||
@@ -196,6 +198,7 @@ class MornyeArtistHeader extends StatelessWidget {
|
||||
? 0.0
|
||||
: 7 + textHeight(listeners!, const TextStyle(fontSize: 13));
|
||||
final photoHeight = (width * 0.76).clamp(240.0, 340.0);
|
||||
final badgeHeight = badge == null ? 0.0 : textScaler.scale(13) + 39;
|
||||
final expandedHeight =
|
||||
photoHeight +
|
||||
identityHeight +
|
||||
@@ -242,6 +245,11 @@ class MornyeArtistHeader extends StatelessWidget {
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (badge != null)
|
||||
SizedBox(
|
||||
height: badgeHeight,
|
||||
child: Center(child: badge),
|
||||
),
|
||||
SizedBox(
|
||||
height: identityHeight,
|
||||
child: Center(child: _buildIdentity()),
|
||||
|
||||
Reference in New Issue
Block a user