mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: reply2reply header
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -116,115 +116,125 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel>
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: _key,
|
key: _key,
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
appBar: PreferredSize(
|
body: Column(
|
||||||
preferredSize: Size.fromHeight(widget.source == 'videoDetail' ? 45 : 1),
|
children: [
|
||||||
child: widget.source == 'videoDetail'
|
widget.source == 'videoDetail'
|
||||||
? Container(
|
? Container(
|
||||||
height: 45,
|
height: 45,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border(
|
border: Border(
|
||||||
bottom: BorderSide(
|
bottom: BorderSide(
|
||||||
width: 1,
|
width: 1,
|
||||||
color: Theme.of(context).dividerColor.withOpacity(0.1),
|
color: Theme.of(context).dividerColor.withOpacity(0.1),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
padding: const EdgeInsets.only(left: 12, right: 2),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: <Widget>[
|
||||||
|
Text(widget.isDialogue ? '对话列表' : '评论详情'),
|
||||||
|
IconButton(
|
||||||
|
tooltip: '关闭',
|
||||||
|
icon: const Icon(Icons.close, size: 20),
|
||||||
|
onPressed: Get.back,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Divider(
|
||||||
|
height: 1,
|
||||||
|
color: Theme.of(context).dividerColor.withOpacity(0.1),
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.only(left: 12, right: 2),
|
Expanded(
|
||||||
child: Row(
|
child: ClipRect(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
child: refreshIndicator(
|
||||||
children: <Widget>[
|
onRefresh: () async {
|
||||||
Text(widget.isDialogue ? '对话列表' : '评论详情'),
|
await _videoReplyReplyController.onRefresh();
|
||||||
IconButton(
|
|
||||||
tooltip: '关闭',
|
|
||||||
icon: const Icon(Icons.close, size: 20),
|
|
||||||
onPressed: Get.back,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: Divider(
|
|
||||||
height: 1,
|
|
||||||
color: Theme.of(context).dividerColor.withOpacity(0.1),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
body: refreshIndicator(
|
|
||||||
onRefresh: () async {
|
|
||||||
await _videoReplyReplyController.onRefresh();
|
|
||||||
},
|
|
||||||
child: Obx(
|
|
||||||
() => Stack(
|
|
||||||
children: [
|
|
||||||
ScrollablePositionedList.builder(
|
|
||||||
itemPositionsListener: itemPositionsListener,
|
|
||||||
itemCount:
|
|
||||||
_itemCount(_videoReplyReplyController.loadingState.value),
|
|
||||||
itemScrollController: _videoReplyReplyController.itemScrollCtr,
|
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
if (widget.isDialogue) {
|
|
||||||
return _buildBody(
|
|
||||||
_videoReplyReplyController.loadingState.value, index);
|
|
||||||
} else if (firstFloor != null) {
|
|
||||||
if (index == 0) {
|
|
||||||
return GlobalData().grpcReply
|
|
||||||
? ReplyItemGrpc(
|
|
||||||
replyItem: firstFloor,
|
|
||||||
replyLevel: '2',
|
|
||||||
showReplyRow: false,
|
|
||||||
replyType: widget.replyType,
|
|
||||||
needDivider: false,
|
|
||||||
onReply: () {
|
|
||||||
_onReply(firstFloor, -1);
|
|
||||||
},
|
|
||||||
upMid: _videoReplyReplyController.upMid,
|
|
||||||
isTop: widget.isTop,
|
|
||||||
onViewImage: widget.onViewImage,
|
|
||||||
onDismissed: widget.onDismissed,
|
|
||||||
callback: _getImageCallback,
|
|
||||||
)
|
|
||||||
: ReplyItem(
|
|
||||||
replyItem: firstFloor,
|
|
||||||
replyLevel: '2',
|
|
||||||
showReplyRow: false,
|
|
||||||
replyType: widget.replyType,
|
|
||||||
needDivider: false,
|
|
||||||
onReply: () {
|
|
||||||
_onReply(firstFloor, -1);
|
|
||||||
},
|
|
||||||
onViewImage: widget.onViewImage,
|
|
||||||
onDismissed: widget.onDismissed,
|
|
||||||
callback: _getImageCallback,
|
|
||||||
);
|
|
||||||
} else if (index == 1) {
|
|
||||||
return Divider(
|
|
||||||
height: 20,
|
|
||||||
color: Theme.of(context).dividerColor.withOpacity(0.1),
|
|
||||||
thickness: 6,
|
|
||||||
);
|
|
||||||
} else if (index == 2) {
|
|
||||||
return _sortWidget;
|
|
||||||
} else {
|
|
||||||
return _buildBody(
|
|
||||||
_videoReplyReplyController.loadingState.value,
|
|
||||||
index - 3);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (index == 0) {
|
|
||||||
return _sortWidget;
|
|
||||||
} else {
|
|
||||||
return _buildBody(
|
|
||||||
_videoReplyReplyController.loadingState.value,
|
|
||||||
index - 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
child: Obx(
|
||||||
|
() => Stack(
|
||||||
|
children: [
|
||||||
|
ScrollablePositionedList.builder(
|
||||||
|
itemPositionsListener: itemPositionsListener,
|
||||||
|
itemCount: _itemCount(
|
||||||
|
_videoReplyReplyController.loadingState.value),
|
||||||
|
itemScrollController:
|
||||||
|
_videoReplyReplyController.itemScrollCtr,
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
if (widget.isDialogue) {
|
||||||
|
return _buildBody(
|
||||||
|
_videoReplyReplyController.loadingState.value,
|
||||||
|
index);
|
||||||
|
} else if (firstFloor != null) {
|
||||||
|
if (index == 0) {
|
||||||
|
return GlobalData().grpcReply
|
||||||
|
? ReplyItemGrpc(
|
||||||
|
replyItem: firstFloor,
|
||||||
|
replyLevel: '2',
|
||||||
|
showReplyRow: false,
|
||||||
|
replyType: widget.replyType,
|
||||||
|
needDivider: false,
|
||||||
|
onReply: () {
|
||||||
|
_onReply(firstFloor, -1);
|
||||||
|
},
|
||||||
|
upMid: _videoReplyReplyController.upMid,
|
||||||
|
isTop: widget.isTop,
|
||||||
|
onViewImage: widget.onViewImage,
|
||||||
|
onDismissed: widget.onDismissed,
|
||||||
|
callback: _getImageCallback,
|
||||||
|
)
|
||||||
|
: ReplyItem(
|
||||||
|
replyItem: firstFloor,
|
||||||
|
replyLevel: '2',
|
||||||
|
showReplyRow: false,
|
||||||
|
replyType: widget.replyType,
|
||||||
|
needDivider: false,
|
||||||
|
onReply: () {
|
||||||
|
_onReply(firstFloor, -1);
|
||||||
|
},
|
||||||
|
onViewImage: widget.onViewImage,
|
||||||
|
onDismissed: widget.onDismissed,
|
||||||
|
callback: _getImageCallback,
|
||||||
|
);
|
||||||
|
} else if (index == 1) {
|
||||||
|
return Divider(
|
||||||
|
height: 20,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.dividerColor
|
||||||
|
.withOpacity(0.1),
|
||||||
|
thickness: 6,
|
||||||
|
);
|
||||||
|
} else if (index == 2) {
|
||||||
|
return _sortWidget;
|
||||||
|
} else {
|
||||||
|
return _buildBody(
|
||||||
|
_videoReplyReplyController.loadingState.value,
|
||||||
|
index - 3);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (index == 0) {
|
||||||
|
return _sortWidget;
|
||||||
|
} else {
|
||||||
|
return _buildBody(
|
||||||
|
_videoReplyReplyController.loadingState.value,
|
||||||
|
index - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
if (!widget.isDialogue &&
|
||||||
|
_videoReplyReplyController.loadingState.value
|
||||||
|
is Success)
|
||||||
|
_header,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
if (!widget.isDialogue &&
|
),
|
||||||
_videoReplyReplyController.loadingState.value is Success)
|
|
||||||
_header,
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user