mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: bangumi intro
This commit is contained in:
@@ -19,18 +19,19 @@ import 'package:PiliPalaX/utils/feed_back.dart';
|
|||||||
|
|
||||||
import '../../../utils/utils.dart';
|
import '../../../utils/utils.dart';
|
||||||
import 'controller.dart';
|
import 'controller.dart';
|
||||||
import 'widgets/intro_detail.dart';
|
|
||||||
|
|
||||||
class BangumiIntroPanel extends StatefulWidget {
|
class BangumiIntroPanel extends StatefulWidget {
|
||||||
final int? cid;
|
final int? cid;
|
||||||
final String heroTag;
|
final String heroTag;
|
||||||
final Function showEpisodes;
|
final Function showEpisodes;
|
||||||
|
final Function showIntroDetail;
|
||||||
|
|
||||||
const BangumiIntroPanel({
|
const BangumiIntroPanel({
|
||||||
Key? key,
|
Key? key,
|
||||||
this.cid,
|
this.cid,
|
||||||
required this.heroTag,
|
required this.heroTag,
|
||||||
required this.showEpisodes,
|
required this.showEpisodes,
|
||||||
|
required this.showIntroDetail,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -76,6 +77,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
|||||||
bangumiDetail: loadingState.response,
|
bangumiDetail: loadingState.response,
|
||||||
cid: cid,
|
cid: cid,
|
||||||
showEpisodes: widget.showEpisodes,
|
showEpisodes: widget.showEpisodes,
|
||||||
|
showIntroDetail: widget.showIntroDetail,
|
||||||
)
|
)
|
||||||
: loadingState is Error
|
: loadingState is Error
|
||||||
? HttpError(
|
? HttpError(
|
||||||
@@ -87,6 +89,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
|||||||
bangumiDetail: null,
|
bangumiDetail: null,
|
||||||
cid: cid,
|
cid: cid,
|
||||||
showEpisodes: widget.showEpisodes,
|
showEpisodes: widget.showEpisodes,
|
||||||
|
showIntroDetail: widget.showIntroDetail,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,12 +101,14 @@ class BangumiInfo extends StatefulWidget {
|
|||||||
this.bangumiDetail,
|
this.bangumiDetail,
|
||||||
this.cid,
|
this.cid,
|
||||||
required this.showEpisodes,
|
required this.showEpisodes,
|
||||||
|
required this.showIntroDetail,
|
||||||
});
|
});
|
||||||
|
|
||||||
final bool loadingStatus;
|
final bool loadingStatus;
|
||||||
final BangumiInfoModel? bangumiDetail;
|
final BangumiInfoModel? bangumiDetail;
|
||||||
final int? cid;
|
final int? cid;
|
||||||
final Function showEpisodes;
|
final Function showEpisodes;
|
||||||
|
final Function showIntroDetail;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<BangumiInfo> createState() => _BangumiInfoState();
|
State<BangumiInfo> createState() => _BangumiInfoState();
|
||||||
@@ -143,7 +148,7 @@ class _BangumiInfoState extends State<BangumiInfo> {
|
|||||||
|
|
||||||
// 收藏
|
// 收藏
|
||||||
showFavBottomSheet() {
|
showFavBottomSheet() {
|
||||||
if (bangumiIntroController.userInfo.mid == null) {
|
if (bangumiIntroController.userInfo == null) {
|
||||||
SmartDialog.showToast('账号未登录');
|
SmartDialog.showToast('账号未登录');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -160,13 +165,7 @@ class _BangumiInfoState extends State<BangumiInfo> {
|
|||||||
// 视频介绍
|
// 视频介绍
|
||||||
showIntroDetail() {
|
showIntroDetail() {
|
||||||
feedBack();
|
feedBack();
|
||||||
showBottomSheet(
|
widget.showIntroDetail(widget.bangumiDetail);
|
||||||
context: context,
|
|
||||||
enableDrag: true,
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return IntroDetail(bangumiDetail: widget.bangumiDetail!);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ class ActionItem extends StatelessWidget {
|
|||||||
child: Semantics(
|
child: Semantics(
|
||||||
label: (text ?? "") + (selectStatus ? "已" : "") + semanticsLabel,
|
label: (text ?? "") + (selectStatus ? "已" : "") + semanticsLabel,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(6),
|
||||||
onTap: () => {
|
onTap: () => {
|
||||||
feedBack(),
|
feedBack(),
|
||||||
onTap!(),
|
onTap!(),
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class _FavPanelState extends State<FavPanel> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
height: Utils.getSheetHeight(context),
|
height: Utils.getSheetHeight(context),
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.surface,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
AppBar(
|
AppBar(
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class IntroDetail extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 10),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: SelectableRegion(
|
child: SelectableRegion(
|
||||||
@@ -86,9 +86,12 @@ class IntroDetail extends StatelessWidget {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(
|
Text(
|
||||||
videoDetail!.bvid!,
|
videoDetail!.bvid!,
|
||||||
style: const TextStyle(fontSize: 13),
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 10),
|
||||||
Text.rich(
|
Text.rich(
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
height: 1.4,
|
height: 1.4,
|
||||||
|
|||||||
@@ -5,8 +5,12 @@ import 'dart:math';
|
|||||||
import 'package:PiliPalaX/common/constants.dart';
|
import 'package:PiliPalaX/common/constants.dart';
|
||||||
import 'package:PiliPalaX/common/widgets/list_sheet.dart';
|
import 'package:PiliPalaX/common/widgets/list_sheet.dart';
|
||||||
import 'package:PiliPalaX/http/loading_state.dart';
|
import 'package:PiliPalaX/http/loading_state.dart';
|
||||||
|
import 'package:PiliPalaX/models/bangumi/info.dart';
|
||||||
import 'package:PiliPalaX/models/common/reply_type.dart';
|
import 'package:PiliPalaX/models/common/reply_type.dart';
|
||||||
import 'package:PiliPalaX/pages/video/detail/introduction/widgets/intro_detail.dart';
|
import 'package:PiliPalaX/pages/bangumi/introduction/widgets/intro_detail.dart'
|
||||||
|
as bangumi;
|
||||||
|
import 'package:PiliPalaX/pages/video/detail/introduction/widgets/intro_detail.dart'
|
||||||
|
as video;
|
||||||
import 'package:PiliPalaX/pages/video/detail/reply_reply/view.dart';
|
import 'package:PiliPalaX/pages/video/detail/reply_reply/view.dart';
|
||||||
import 'package:PiliPalaX/pages/video/detail/widgets/ai_detail.dart';
|
import 'package:PiliPalaX/pages/video/detail/widgets/ai_detail.dart';
|
||||||
import 'package:PiliPalaX/utils/extension.dart';
|
import 'package:PiliPalaX/utils/extension.dart';
|
||||||
@@ -423,6 +427,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
String introText = '简介',
|
String introText = '简介',
|
||||||
bool isSingle = false,
|
bool isSingle = false,
|
||||||
]) {
|
]) {
|
||||||
|
if (videoDetailController.tabCtr.length != (isSingle ? 1 : 2)) {
|
||||||
|
videoDetailController.tabCtr =
|
||||||
|
TabController(length: isSingle ? 1 : 2, vsync: this);
|
||||||
|
}
|
||||||
return Container(
|
return Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 45,
|
height: 45,
|
||||||
@@ -735,6 +743,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
cid:
|
cid:
|
||||||
videoDetailController.cid.value,
|
videoDetailController.cid.value,
|
||||||
showEpisodes: showEpisodes,
|
showEpisodes: showEpisodes,
|
||||||
|
showIntroDetail: showIntroDetail,
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
@@ -855,6 +864,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
heroTag: heroTag,
|
heroTag: heroTag,
|
||||||
cid: videoDetailController.cid.value,
|
cid: videoDetailController.cid.value,
|
||||||
showEpisodes: showEpisodes,
|
showEpisodes: showEpisodes,
|
||||||
|
showIntroDetail: showIntroDetail,
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
@@ -970,6 +980,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
heroTag: heroTag,
|
heroTag: heroTag,
|
||||||
cid: videoDetailController.cid.value,
|
cid: videoDetailController.cid.value,
|
||||||
showEpisodes: showEpisodes,
|
showEpisodes: showEpisodes,
|
||||||
|
showIntroDetail: showIntroDetail,
|
||||||
)),
|
)),
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@@ -1013,6 +1024,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
heroTag: heroTag,
|
heroTag: heroTag,
|
||||||
cid: videoDetailController.cid.value,
|
cid: videoDetailController.cid.value,
|
||||||
showEpisodes: showEpisodes,
|
showEpisodes: showEpisodes,
|
||||||
|
showIntroDetail: showIntroDetail,
|
||||||
)),
|
)),
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@@ -1200,6 +1212,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
heroTag: heroTag,
|
heroTag: heroTag,
|
||||||
cid: videoDetailController.cid.value,
|
cid: videoDetailController.cid.value,
|
||||||
showEpisodes: showEpisodes,
|
showEpisodes: showEpisodes,
|
||||||
|
showIntroDetail: showIntroDetail,
|
||||||
)),
|
)),
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@@ -1442,7 +1455,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
|
|
||||||
showIntroDetail(videoDetail) {
|
showIntroDetail(videoDetail) {
|
||||||
scaffoldKey.currentState?.showBottomSheet(
|
scaffoldKey.currentState?.showBottomSheet(
|
||||||
enableDrag: true, (context) => IntroDetail(videoDetail: videoDetail));
|
enableDrag: true,
|
||||||
|
(context) => videoDetail is BangumiInfoModel
|
||||||
|
? bangumi.IntroDetail(bangumiDetail: videoDetail)
|
||||||
|
: video.IntroDetail(videoDetail: videoDetail));
|
||||||
}
|
}
|
||||||
|
|
||||||
showEpisodes(episodes, bvid, aid, cid) {
|
showEpisodes(episodes, bvid, aid, cid) {
|
||||||
|
|||||||
Reference in New Issue
Block a user