mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-01 23:00:14 +08:00
fix: all music achievement (#2363)
* fix: all music achievement * remove empty space [skip ci] --------- Co-authored-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -82,26 +82,21 @@ class PBadge extends StatelessWidget {
|
|||||||
color = theme.onSurfaceVariant;
|
color = theme.onSurfaceVariant;
|
||||||
}
|
}
|
||||||
|
|
||||||
late EdgeInsets paddingStyle = const EdgeInsets.symmetric(
|
late EdgeInsets paddingStyle = const .symmetric(vertical: 2, horizontal: 3);
|
||||||
vertical: 2,
|
final BorderRadius br = size == .small
|
||||||
horizontal: 3,
|
? const .all(.circular(3))
|
||||||
);
|
: const .all(.circular(4));
|
||||||
BorderRadius br = size == PBadgeSize.small
|
|
||||||
? const BorderRadius.all(Radius.circular(3))
|
|
||||||
: const BorderRadius.all(Radius.circular(4));
|
|
||||||
|
|
||||||
Widget content = Container(
|
Widget content = Container(
|
||||||
padding: padding ?? paddingStyle,
|
padding: padding ?? paddingStyle,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: br,
|
borderRadius: br,
|
||||||
color: bgColor,
|
color: bgColor,
|
||||||
border: Border.all(color: borderColor),
|
border: .all(color: borderColor),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
text!,
|
text!,
|
||||||
textScaler: textScaleFactor != null
|
textScaler: textScaleFactor != null ? .linear(textScaleFactor!) : null,
|
||||||
? TextScaler.linear(textScaleFactor!)
|
|
||||||
: null,
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
height: 1,
|
height: 1,
|
||||||
fontSize: fontSize,
|
fontSize: fontSize,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class MusicDetail {
|
|||||||
required this.album,
|
required this.album,
|
||||||
required this.artistsList,
|
required this.artistsList,
|
||||||
required this.listenPv,
|
required this.listenPv,
|
||||||
required this.musicRank,
|
required this.achievement,
|
||||||
required this.hotSongHeat,
|
required this.hotSongHeat,
|
||||||
required this.musicComment,
|
required this.musicComment,
|
||||||
required this.musicRelation,
|
required this.musicRelation,
|
||||||
@@ -26,7 +26,7 @@ class MusicDetail {
|
|||||||
final String? originArtist;
|
final String? originArtist;
|
||||||
final String? originArtistList;
|
final String? originArtistList;
|
||||||
final int? mvAid;
|
final int? mvAid;
|
||||||
final int? mvCid;
|
final int mvCid;
|
||||||
final String? mvBvid;
|
final String? mvBvid;
|
||||||
final String? mvCover;
|
final String? mvCover;
|
||||||
bool? wishListen;
|
bool? wishListen;
|
||||||
@@ -35,7 +35,7 @@ class MusicDetail {
|
|||||||
final String? album;
|
final String? album;
|
||||||
final List<Artist>? artistsList;
|
final List<Artist>? artistsList;
|
||||||
final int? listenPv;
|
final int? listenPv;
|
||||||
final String? musicRank;
|
final List<String> achievement;
|
||||||
final HotSongHeat? hotSongHeat;
|
final HotSongHeat? hotSongHeat;
|
||||||
final MusicComment? musicComment;
|
final MusicComment? musicComment;
|
||||||
final int? musicRelation;
|
final int? musicRelation;
|
||||||
@@ -47,7 +47,7 @@ class MusicDetail {
|
|||||||
originArtist: json["origin_artist"],
|
originArtist: json["origin_artist"],
|
||||||
originArtistList: json["origin_artist_list"],
|
originArtistList: json["origin_artist_list"],
|
||||||
mvAid: json["mv_aid"],
|
mvAid: json["mv_aid"],
|
||||||
mvCid: json["mv_cid"],
|
mvCid: json["mv_cid"] ?? 0,
|
||||||
mvBvid: json["mv_bvid"],
|
mvBvid: json["mv_bvid"],
|
||||||
mvCover: json["mv_cover"],
|
mvCover: json["mv_cover"],
|
||||||
wishListen: json["wish_listen"],
|
wishListen: json["wish_listen"],
|
||||||
@@ -58,7 +58,11 @@ class MusicDetail {
|
|||||||
?.map((x) => Artist.fromJson(x))
|
?.map((x) => Artist.fromJson(x))
|
||||||
.toList(),
|
.toList(),
|
||||||
listenPv: json["listen_pv"],
|
listenPv: json["listen_pv"],
|
||||||
musicRank: json["music_rank"],
|
achievement: [
|
||||||
|
...?json["achievement"],
|
||||||
|
?json["music_rank"],
|
||||||
|
?json["recreation_rank"],
|
||||||
|
],
|
||||||
hotSongHeat: json["hot_song_heat"] == null
|
hotSongHeat: json["hot_song_heat"] == null
|
||||||
? null
|
? null
|
||||||
: HotSongHeat.fromJson(json["hot_song_heat"]),
|
: HotSongHeat.fromJson(json["hot_song_heat"]),
|
||||||
|
|||||||
@@ -452,35 +452,35 @@ class _MusicDetailPageState extends CommonDynPageState<MusicDetailPage> {
|
|||||||
Wrap(
|
Wrap(
|
||||||
spacing: 16,
|
spacing: 16,
|
||||||
children: [
|
children: [
|
||||||
if (!item.musicRank.isNullOrEmpty)
|
if (item.achievement.isNotEmpty)
|
||||||
PBadge(
|
for (var i in item.achievement)
|
||||||
text: item.musicRank,
|
if (i.isNotEmpty)
|
||||||
type: .secondary,
|
PBadge(
|
||||||
isStack: false,
|
text: i,
|
||||||
fontSize: 11,
|
type: .secondary,
|
||||||
),
|
isStack: false,
|
||||||
if (item.mvCid != null && item.mvCid != 0)
|
fontSize: 11,
|
||||||
|
),
|
||||||
|
if (item.mvCid != 0)
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () => PageUtils.toVideoPage(
|
onTap: () => PageUtils.toVideoPage(
|
||||||
bvid: item.mvBvid,
|
bvid: item.mvBvid,
|
||||||
cid: item.mvCid!,
|
cid: item.mvCid,
|
||||||
aid: item.mvAid,
|
aid: item.mvAid,
|
||||||
),
|
),
|
||||||
child: DecoratedBox(
|
child: DecoratedBox(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const .all(.circular(4)),
|
||||||
Radius.circular(4),
|
|
||||||
),
|
|
||||||
color: theme.colorScheme.secondaryContainer
|
color: theme.colorScheme.secondaryContainer
|
||||||
.withValues(alpha: 0.5),
|
.withValues(alpha: 0.5),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const .symmetric(
|
||||||
vertical: 3,
|
vertical: 3,
|
||||||
horizontal: 4,
|
horizontal: 4,
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: .min,
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
Icons.play_circle_outline,
|
Icons.play_circle_outline,
|
||||||
|
|||||||
Reference in New Issue
Block a user