mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-22 10:06:23 +08:00
feat: audio page (#1518)
* feat: audio page Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * opt ui Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * impl intro, share, fav Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * tweaks Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * load prev/next Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> --------- Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -253,9 +253,8 @@ class AuthorPanel extends StatelessWidget {
|
||||
InkWell(
|
||||
onTap: Get.back,
|
||||
borderRadius: StyleString.bottomSheetRadius,
|
||||
child: Container(
|
||||
child: SizedBox(
|
||||
height: 35,
|
||||
padding: const EdgeInsets.only(bottom: 2),
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: 32,
|
||||
|
||||
@@ -162,30 +162,49 @@ class DynamicPanel extends StatelessWidget {
|
||||
late final major = item.modules.moduleDynamic?.major;
|
||||
switch (item.type) {
|
||||
case 'DYNAMIC_TYPE_AV':
|
||||
title = major?.archive?.title;
|
||||
cover = major?.archive?.cover;
|
||||
bvid = major?.archive?.bvid;
|
||||
if (major?.archive case final archive?) {
|
||||
title = archive.title;
|
||||
cover = archive.cover;
|
||||
bvid = archive.bvid;
|
||||
}
|
||||
break;
|
||||
case 'DYNAMIC_TYPE_UGC_SEASON':
|
||||
title = major?.ugcSeason?.title;
|
||||
cover = major?.ugcSeason?.cover;
|
||||
bvid = major?.ugcSeason?.bvid;
|
||||
if (major?.ugcSeason case final ugcSeason?) {
|
||||
title = ugcSeason.title;
|
||||
cover = ugcSeason.cover;
|
||||
bvid = ugcSeason.bvid;
|
||||
}
|
||||
break;
|
||||
case 'DYNAMIC_TYPE_PGC' || 'DYNAMIC_TYPE_PGC_UNION':
|
||||
title = major?.pgc?.title;
|
||||
cover = major?.pgc?.cover;
|
||||
if (major?.pgc case final pgc?) {
|
||||
title = pgc.title;
|
||||
cover = pgc.cover;
|
||||
}
|
||||
break;
|
||||
case 'DYNAMIC_TYPE_LIVE_RCMD':
|
||||
title = major?.liveRcmd?.title;
|
||||
cover = major?.liveRcmd?.cover;
|
||||
if (major?.liveRcmd case final liveRcmd?) {
|
||||
title = liveRcmd.title;
|
||||
cover = liveRcmd.cover;
|
||||
}
|
||||
break;
|
||||
case 'DYNAMIC_TYPE_LIVE':
|
||||
title = major?.live?.title;
|
||||
cover = major?.live?.cover;
|
||||
if (major?.live case final live?) {
|
||||
title = live.title;
|
||||
cover = live.cover;
|
||||
}
|
||||
break;
|
||||
case 'DYNAMIC_TYPE_COURSES_SEASON':
|
||||
title = major?.courses?.title;
|
||||
cover = major?.courses?.cover;
|
||||
if (major?.courses case final courses?) {
|
||||
title = courses.title;
|
||||
cover = courses.cover;
|
||||
}
|
||||
break;
|
||||
case 'DYNAMIC_TYPE_SUBSCRIPTION_NEW':
|
||||
if (major?.subscriptionNew?.liveRcmd?.content?.livePlayInfo
|
||||
case final livePlayInfo?) {
|
||||
title = livePlayInfo.title;
|
||||
cover = livePlayInfo.cover;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
morePanel(context);
|
||||
|
||||
@@ -2,7 +2,10 @@ import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/widgets/badge.dart';
|
||||
import 'package:PiliPlus/common/widgets/dyn/ink_well.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||
import 'package:PiliPlus/grpc/bilibili/app/listener/v1.pbenum.dart'
|
||||
show PlaylistSource;
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
import 'package:PiliPlus/pages/audio/view.dart';
|
||||
import 'package:PiliPlus/pages/dynamics/widgets/forward_panel.dart';
|
||||
import 'package:PiliPlus/pages/dynamics/widgets/live_panel.dart';
|
||||
import 'package:PiliPlus/pages/dynamics/widgets/live_panel_sub.dart';
|
||||
@@ -197,50 +200,64 @@ Widget module(
|
||||
),
|
||||
);
|
||||
case 'DYNAMIC_TYPE_MUSIC':
|
||||
final Map music = major!.music!;
|
||||
return InkWell(
|
||||
onTap: () => PageUtils.handleWebview("https:${music['jump_url']}"),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 12,
|
||||
top: 10,
|
||||
right: 12,
|
||||
bottom: 10,
|
||||
final music = major!.music!;
|
||||
final borderRadius = floor == 1 ? null : StyleString.mdRadius;
|
||||
final Color bgColor = floor == 1
|
||||
? theme.dividerColor.withValues(alpha: 0.08)
|
||||
: theme.colorScheme.surface;
|
||||
return Material(
|
||||
color: bgColor,
|
||||
borderRadius: borderRadius,
|
||||
child: InkWell(
|
||||
borderRadius: borderRadius,
|
||||
onTap: () => AudioPage.toAudioPage(
|
||||
oid: music.id!,
|
||||
itemType: 3,
|
||||
from: PlaylistSource.AUDIO_CARD,
|
||||
),
|
||||
color: theme.dividerColor.withValues(alpha: 0.08),
|
||||
child: Row(
|
||||
children: [
|
||||
NetworkImgLayer(
|
||||
radius: 8,
|
||||
width: 45,
|
||||
height: 45,
|
||||
src: music['cover'],
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
music['title'],
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 12,
|
||||
top: 10,
|
||||
right: 12,
|
||||
bottom: 10,
|
||||
),
|
||||
child: Row(
|
||||
spacing: 10,
|
||||
children: [
|
||||
NetworkImgLayer(
|
||||
radius: 8,
|
||||
width: 45,
|
||||
height: 45,
|
||||
src: music.cover,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
music.title!,
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
music.label!,
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.outline,
|
||||
fontSize: theme.textTheme.labelMedium!.fontSize,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
music['label'],
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.outline,
|
||||
fontSize: theme.textTheme.labelMedium!.fontSize,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user