mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 08:38:18 +08:00
opt: episodes showing
This commit is contained in:
@@ -24,10 +24,13 @@ import 'widgets/intro_detail.dart';
|
||||
class BangumiIntroPanel extends StatefulWidget {
|
||||
final int? cid;
|
||||
final String heroTag;
|
||||
final Function showEpisodes;
|
||||
|
||||
const BangumiIntroPanel({
|
||||
Key? key,
|
||||
this.cid,
|
||||
required this.heroTag,
|
||||
required this.showEpisodes,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
@@ -72,6 +75,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
||||
loadingStatus: false,
|
||||
bangumiDetail: loadingState.response,
|
||||
cid: cid,
|
||||
showEpisodes: widget.showEpisodes,
|
||||
)
|
||||
: loadingState is Error
|
||||
? HttpError(
|
||||
@@ -82,6 +86,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
||||
loadingStatus: true,
|
||||
bangumiDetail: null,
|
||||
cid: cid,
|
||||
showEpisodes: widget.showEpisodes,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -92,11 +97,13 @@ class BangumiInfo extends StatefulWidget {
|
||||
this.loadingStatus = false,
|
||||
this.bangumiDetail,
|
||||
this.cid,
|
||||
required this.showEpisodes,
|
||||
});
|
||||
|
||||
final bool loadingStatus;
|
||||
final BangumiInfoModel? bangumiDetail;
|
||||
final int? cid;
|
||||
final Function showEpisodes;
|
||||
|
||||
@override
|
||||
State<BangumiInfo> createState() => _BangumiInfoState();
|
||||
@@ -342,6 +349,7 @@ class _BangumiInfoState extends State<BangumiInfo> {
|
||||
? bangumiItem!.episodes!.first.cid
|
||||
: widget.bangumiDetail!.episodes!.first.cid),
|
||||
changeFuc: bangumiIntroController.changeSeasonOrbangu,
|
||||
showEpisodes: widget.showEpisodes,
|
||||
)
|
||||
],
|
||||
],
|
||||
|
||||
@@ -6,7 +6,6 @@ import 'package:PiliPalaX/models/bangumi/info.dart';
|
||||
import 'package:PiliPalaX/pages/video/detail/index.dart';
|
||||
import 'package:PiliPalaX/utils/storage.dart';
|
||||
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
|
||||
import 'package:PiliPalaX/common/widgets/list_sheet.dart';
|
||||
|
||||
class BangumiPanel extends StatefulWidget {
|
||||
const BangumiPanel({
|
||||
@@ -14,11 +13,13 @@ class BangumiPanel extends StatefulWidget {
|
||||
required this.pages,
|
||||
this.cid,
|
||||
required this.changeFuc,
|
||||
required this.showEpisodes,
|
||||
});
|
||||
|
||||
final List<EpisodeItem> pages;
|
||||
final int? cid;
|
||||
final Function changeFuc;
|
||||
final Function showEpisodes;
|
||||
|
||||
@override
|
||||
State<BangumiPanel> createState() => _BangumiPanelState();
|
||||
@@ -113,18 +114,13 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
||||
height: 34,
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () {
|
||||
ListSheet(
|
||||
episodes: widget.pages,
|
||||
bvid: widget.pages[currentIndex].bvid!,
|
||||
aid: widget.pages[currentIndex].aid!,
|
||||
currentCid: cid,
|
||||
changeFucCall: widget.changeFuc,
|
||||
context: context)
|
||||
.buildShowBottomSheet();
|
||||
},
|
||||
onPressed: () => widget.showEpisodes(
|
||||
widget.pages,
|
||||
widget.pages[currentIndex].bvid,
|
||||
widget.pages[currentIndex].aid,
|
||||
cid),
|
||||
child: Text(
|
||||
'全${widget.pages.length}话',
|
||||
style: const TextStyle(fontSize: 13),
|
||||
|
||||
Reference in New Issue
Block a user