spotube/lib/helpers/artists-to-clickable-artists.dart
Kingkor Roy Tirtho b3511e4919 Playlist TrackTile is now responsive
PlaylistView/SearchAlbumView are responsive now
ArtistProfile album view & tracks view are paginated now
2022-03-01 10:26:20 +06:00

34 lines
1.0 KiB
Dart

import 'package:flutter/material.dart';
import 'package:spotify/spotify.dart';
import 'package:spotube/components/Artist/ArtistProfile.dart';
import 'package:spotube/components/Shared/LinkText.dart';
import 'package:spotube/components/Shared/SpotubePageRoute.dart';
Widget artistsToClickableArtists(
List<ArtistSimple> artists, {
CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
TextStyle textStyle = const TextStyle(),
}) {
return Row(
crossAxisAlignment: crossAxisAlignment,
mainAxisAlignment: mainAxisAlignment,
children: artists
.asMap()
.entries
.map(
(artist) => LinkText(
(artist.key != artists.length - 1)
? "${artist.value.name}, "
: artist.value.name!,
SpotubePageRoute(
child: ArtistProfile(artist.value.id!),
),
overflow: TextOverflow.ellipsis,
style: textStyle,
),
)
.toList(),
);
}