mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
@@ -86,7 +86,7 @@ class _SeasonPanelState extends State<SeasonPanel> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (episodes.isEmpty) {
|
||||
return const SizedBox();
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return Builder(builder: (BuildContext context) {
|
||||
return Container(
|
||||
|
||||
@@ -135,13 +135,11 @@ class _NoteListPageState extends CommonSlidePageState<NoteListPage> {
|
||||
Loading() => CustomScrollView(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
slivers: [
|
||||
SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(BuildContext context, int index) {
|
||||
return const VideoReplySkeleton();
|
||||
},
|
||||
childCount: 8,
|
||||
),
|
||||
SliverList.builder(
|
||||
itemBuilder: (context, index) {
|
||||
return const VideoReplySkeleton();
|
||||
},
|
||||
itemCount: 8,
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
@@ -196,71 +196,67 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
|
||||
Widget _buildBody(LoadingState loadingState) {
|
||||
return switch (loadingState) {
|
||||
Loading() => SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(BuildContext context, index) {
|
||||
return const VideoReplySkeleton();
|
||||
},
|
||||
childCount: 5,
|
||||
),
|
||||
Loading() => SliverList.builder(
|
||||
itemBuilder: (BuildContext context, index) {
|
||||
return const VideoReplySkeleton();
|
||||
},
|
||||
itemCount: 5,
|
||||
),
|
||||
Success() => loadingState.response?.isNotEmpty == true
|
||||
? SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(BuildContext context, index) {
|
||||
double bottom = MediaQuery.of(context).padding.bottom;
|
||||
if (index == loadingState.response.length) {
|
||||
_videoReplyController.onLoadMore();
|
||||
return Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.only(bottom: bottom),
|
||||
height: bottom + 100,
|
||||
child: Text(
|
||||
_videoReplyController.isEnd.not
|
||||
? '加载中...'
|
||||
: loadingState.response.isEmpty
|
||||
? '还没有评论'
|
||||
: '没有更多了',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
),
|
||||
? SliverList.builder(
|
||||
itemBuilder: (context, index) {
|
||||
double bottom = MediaQuery.of(context).padding.bottom;
|
||||
if (index == loadingState.response.length) {
|
||||
_videoReplyController.onLoadMore();
|
||||
return Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.only(bottom: bottom),
|
||||
height: bottom + 100,
|
||||
child: Text(
|
||||
_videoReplyController.isEnd.not
|
||||
? '加载中...'
|
||||
: loadingState.response.isEmpty
|
||||
? '还没有评论'
|
||||
: '没有更多了',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return ReplyItemGrpc(
|
||||
replyItem: loadingState.response[index],
|
||||
replyLevel: widget.replyLevel,
|
||||
replyReply: widget.replyReply,
|
||||
onReply: () {
|
||||
_videoReplyController.onReply(
|
||||
context,
|
||||
replyItem: loadingState.response[index],
|
||||
index: index,
|
||||
);
|
||||
},
|
||||
onDelete: (subIndex) =>
|
||||
_videoReplyController.onRemove(index, subIndex),
|
||||
upMid: _videoReplyController.upMid,
|
||||
getTag: () => heroTag,
|
||||
onViewImage: widget.onViewImage,
|
||||
onDismissed: widget.onDismissed,
|
||||
callback: widget.callback,
|
||||
onCheckReply: (item) =>
|
||||
_videoReplyController.onCheckReply(context, item),
|
||||
onToggleTop: (isUpTop, rpid) =>
|
||||
_videoReplyController.onToggleTop(
|
||||
index,
|
||||
_videoReplyController.aid,
|
||||
ReplyType.video.index,
|
||||
isUpTop,
|
||||
rpid,
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
childCount: loadingState.response.length + 1,
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return ReplyItemGrpc(
|
||||
replyItem: loadingState.response[index],
|
||||
replyLevel: widget.replyLevel,
|
||||
replyReply: widget.replyReply,
|
||||
onReply: () {
|
||||
_videoReplyController.onReply(
|
||||
context,
|
||||
replyItem: loadingState.response[index],
|
||||
index: index,
|
||||
);
|
||||
},
|
||||
onDelete: (subIndex) =>
|
||||
_videoReplyController.onRemove(index, subIndex),
|
||||
upMid: _videoReplyController.upMid,
|
||||
getTag: () => heroTag,
|
||||
onViewImage: widget.onViewImage,
|
||||
onDismissed: widget.onDismissed,
|
||||
callback: widget.callback,
|
||||
onCheckReply: (item) =>
|
||||
_videoReplyController.onCheckReply(context, item),
|
||||
onToggleTop: (isUpTop, rpid) =>
|
||||
_videoReplyController.onToggleTop(
|
||||
index,
|
||||
_videoReplyController.aid,
|
||||
ReplyType.video.index,
|
||||
isUpTop,
|
||||
rpid,
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
itemCount: loadingState.response.length + 1,
|
||||
)
|
||||
: HttpError(
|
||||
errMsg: '还没有评论',
|
||||
|
||||
@@ -391,13 +391,11 @@ class _VideoReplyReplyPanelState
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
slivers: [
|
||||
SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(BuildContext context, int index) {
|
||||
return const VideoReplySkeleton();
|
||||
},
|
||||
childCount: 8,
|
||||
),
|
||||
SliverList.builder(
|
||||
itemBuilder: (context, index) {
|
||||
return const VideoReplySkeleton();
|
||||
},
|
||||
itemCount: 8,
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1226,7 +1226,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
|
||||
Widget get childWhenEnabled => Obx(
|
||||
() => !videoDetailController.autoPlay.value
|
||||
? const SizedBox()
|
||||
? const SizedBox.shrink()
|
||||
: PLVideoPlayer(
|
||||
key: Key(heroTag),
|
||||
plPlayerController: plPlayerController!,
|
||||
|
||||
@@ -782,7 +782,7 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
Icons.done,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
)
|
||||
: const SizedBox(),
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
]
|
||||
],
|
||||
@@ -858,7 +858,7 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
Icons.done,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
)
|
||||
: const SizedBox(),
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
]
|
||||
],
|
||||
@@ -1832,7 +1832,7 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
Icons.done,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
)
|
||||
: const SizedBox(),
|
||||
: const SizedBox.shrink(),
|
||||
)
|
||||
],
|
||||
],
|
||||
@@ -2014,7 +2014,7 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
}
|
||||
clock?.cancel();
|
||||
clock = null;
|
||||
return SizedBox.shrink();
|
||||
return const SizedBox.shrink();
|
||||
},
|
||||
),
|
||||
if (videoDetailCtr.enableSponsorBlock == true)
|
||||
|
||||
Reference in New Issue
Block a user