fix: 番剧badge
This commit is contained in:
@ -362,17 +362,17 @@ class _BangumiInfoState extends State<BangumiInfo> {
|
|||||||
bangumiItem != null &&
|
bangumiItem != null &&
|
||||||
bangumiItem!.episodes!.isNotEmpty) ...[
|
bangumiItem!.episodes!.isNotEmpty) ...[
|
||||||
BangumiPanel(
|
BangumiPanel(
|
||||||
pages: bangumiItem != null
|
pages: bangumiItem != null
|
||||||
? bangumiItem!.episodes!
|
? bangumiItem!.episodes!
|
||||||
: widget.bangumiDetail!.episodes!,
|
: widget.bangumiDetail!.episodes!,
|
||||||
cid: cid ??
|
cid: cid ??
|
||||||
(bangumiItem != null
|
(bangumiItem != null
|
||||||
? bangumiItem!.episodes!.first.cid
|
? bangumiItem!.episodes!.first.cid
|
||||||
: widget.bangumiDetail!.episodes!.first.cid),
|
: widget.bangumiDetail!.episodes!.first.cid),
|
||||||
sheetHeight: sheetHeight,
|
sheetHeight: sheetHeight,
|
||||||
changeFuc: (bvid, cid, aid) => bangumiIntroController
|
changeFuc: (bvid, cid, aid) => bangumiIntroController
|
||||||
.changeSeasonOrbangu(bvid, cid, aid),
|
.changeSeasonOrbangu(bvid, cid, aid),
|
||||||
)
|
bangumiDetail: widget.bangumiDetail ?? bangumiItem)
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -14,12 +14,14 @@ class BangumiPanel extends StatefulWidget {
|
|||||||
this.cid,
|
this.cid,
|
||||||
this.sheetHeight,
|
this.sheetHeight,
|
||||||
this.changeFuc,
|
this.changeFuc,
|
||||||
|
this.bangumiDetail,
|
||||||
});
|
});
|
||||||
|
|
||||||
final List<EpisodeItem> pages;
|
final List<EpisodeItem> pages;
|
||||||
final int? cid;
|
final int? cid;
|
||||||
final double? sheetHeight;
|
final double? sheetHeight;
|
||||||
final Function? changeFuc;
|
final Function? changeFuc;
|
||||||
|
final BangumiInfoModel? bangumiDetail;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<BangumiPanel> createState() => _BangumiPanelState();
|
State<BangumiPanel> createState() => _BangumiPanelState();
|
||||||
@ -87,7 +89,7 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
|||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
title: Text(
|
title: Text(
|
||||||
'第${index + 1}话 ${page.longTitle!}',
|
'第${page.title}话 ${page.longTitle!}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: isCurrentIndex
|
color: isCurrentIndex
|
||||||
@ -96,9 +98,11 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
trailing: page.badge != null
|
trailing: page.badge != null
|
||||||
? Image.asset(
|
? Text(
|
||||||
'assets/images/big-vip.png',
|
page.badge!,
|
||||||
height: 20,
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
: const SizedBox(),
|
: const SizedBox(),
|
||||||
);
|
);
|
||||||
@ -201,11 +205,11 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
|||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 10, bottom: 6),
|
padding: const EdgeInsets.only(top: 10, bottom: 10),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
const Text('合集 '),
|
const Text('选集 '),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
' 正在播放:${widget.pages[currentIndex].longTitle}',
|
' 正在播放:${widget.pages[currentIndex].longTitle}',
|
||||||
@ -225,7 +229,7 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
|||||||
),
|
),
|
||||||
onPressed: () => showBangumiPanel(),
|
onPressed: () => showBangumiPanel(),
|
||||||
child: Text(
|
child: Text(
|
||||||
'全${widget.pages.length}话',
|
'${widget.bangumiDetail!.newEp!['desc']}',
|
||||||
style: const TextStyle(fontSize: 13),
|
style: const TextStyle(fontSize: 13),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -278,23 +282,15 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 2),
|
const SizedBox(width: 2),
|
||||||
if (widget.pages[i].badge != null) ...[
|
if (widget.pages[i].badge != null) ...[
|
||||||
if (widget.pages[i].badge == '会员') ...[
|
const Spacer(),
|
||||||
Image.asset(
|
Text(
|
||||||
'assets/images/big-vip.png',
|
widget.pages[i].badge!,
|
||||||
height: 16,
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color:
|
||||||
|
Theme.of(context).colorScheme.primary,
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
if (widget.pages[i].badge != '会员') ...[
|
|
||||||
const Spacer(),
|
|
||||||
Text(
|
|
||||||
widget.pages[i].badge!,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 11,
|
|
||||||
color:
|
|
||||||
Theme.of(context).colorScheme.primary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user