diff --git a/lib/pages/bangumi/widgets/bangumi_panel.dart b/lib/pages/bangumi/widgets/bangumi_panel.dart index 04a210302..94c5c9ed8 100644 --- a/lib/pages/bangumi/widgets/bangumi_panel.dart +++ b/lib/pages/bangumi/widgets/bangumi_panel.dart @@ -88,7 +88,7 @@ class _BangumiPanelState extends State { ) : null, title: Text( - '第${index + 1}话 ${page.longTitle!}', + '第' + (page.title ?? '${index + 1}') + '话 ${page.longTitle!}', style: TextStyle( fontSize: 14, color: isCurrentIndex @@ -96,13 +96,13 @@ class _BangumiPanelState extends State { : Theme.of(context).colorScheme.onSurface, ), ), - trailing: page.badge != null + trailing: page.badge != null && page.badge == '会员' ? Image.asset( 'assets/images/big-vip.png', height: 20, semanticLabel: "大会员", ) - : const SizedBox(), + : Text(page.badge ?? ""), ); } @@ -147,15 +147,15 @@ class _BangumiPanelState extends State { Expanded( child: Material( child: ScrollablePositionedList.builder( - itemCount: widget.pages.length, + itemCount: widget.pages.length + 1, itemBuilder: (BuildContext context, int index) { - bool isLastItem = index == widget.pages.length - 1; + bool isLastItem = index == widget.pages.length; bool isCurrentIndex = currentIndex == index; return isLastItem ? SizedBox( height: MediaQuery.of(context).padding.bottom + - 20, + 50, ) : buildPageListItem( widget.pages[index], @@ -271,7 +271,9 @@ class _BangumiPanelState extends State { const SizedBox(width: 6) ], Text( - '第${i + 1}话', + '第' + + (widget.pages[i].title ?? "${i + 1}") + + '话', style: TextStyle( fontSize: 13, color: i == currentIndex @@ -282,6 +284,7 @@ class _BangumiPanelState extends State { ), const SizedBox(width: 2), if (widget.pages[i].badge != null) ...[ + const Spacer(), if (widget.pages[i].badge == '会员') ...[ Image.asset( 'assets/images/big-vip.png', @@ -290,7 +293,6 @@ class _BangumiPanelState extends State { ), ], if (widget.pages[i].badge != '会员') ...[ - const Spacer(), Text( widget.pages[i].badge!, style: TextStyle( diff --git a/lib/pages/video/detail/introduction/widgets/season.dart b/lib/pages/video/detail/introduction/widgets/season.dart index c0adc7bcd..5223d0a34 100644 --- a/lib/pages/video/detail/introduction/widgets/season.dart +++ b/lib/pages/video/detail/introduction/widgets/season.dart @@ -173,9 +173,9 @@ class _SeasonPanelState extends State { bottom: MediaQuery.of(context).padding.bottom), child: Material( child: ScrollablePositionedList.builder( - itemCount: episodes!.length, + itemCount: episodes!.length + 1, itemBuilder: (BuildContext context, int index) { - bool isLastItem = index == episodes!.length - 1; + bool isLastItem = index == episodes!.length; bool isCurrentIndex = currentIndex == index; return isLastItem ? SizedBox(