mod: 评论页弹框高度

This commit is contained in:
guozhigq
2023-07-15 18:25:10 +08:00
parent c7b67c3a10
commit a23103eb69
5 changed files with 27 additions and 13 deletions

View File

@ -73,7 +73,7 @@ class VideoDetailController extends GetxController
queryVideoUrl();
}
showReplyReplyPanel() {
showReplyReplyPanel(paddingTop) {
PersistentBottomSheetController<void>? ctr =
scaffoldKey.currentState?.showBottomSheet<void>((BuildContext context) {
return VideoReplyReplyPanel(
@ -83,6 +83,7 @@ class VideoDetailController extends GetxController
fRpid = 0,
},
firstFloor: firstFloor,
paddingTop: paddingTop,
);
});
ctr?.closed.then((value) {

View File

@ -122,6 +122,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
@override
Widget build(BuildContext context) {
double paddingTop = MediaQuery.of(context).padding.top;
return RefreshIndicator(
onRefresh: () async {
setState(() {});
@ -212,12 +213,13 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (builder) {
builder: (BuildContext context) {
return VideoReplyNewDialog(
replyLevel: '0',
oid: IdUtils.bv2av(Get.parameters['bvid']!),
root: 0,
parent: 0,
paddingTop: paddingTop,
);
},
).then(

View File

@ -222,6 +222,7 @@ class ReplyItem extends StatelessWidget {
// 感谢、回复、复制
Widget bottonAction(context, replyControl) {
var color = Theme.of(context).colorScheme.outline;
double paddingTop = MediaQuery.of(context).padding.top;
return Row(
children: [
const SizedBox(width: 48),
@ -271,11 +272,11 @@ class ReplyItem extends StatelessWidget {
isScrollControlled: true,
builder: (builder) {
return VideoReplyNewDialog(
replyLevel: replyLevel,
oid: replyItem!.oid,
root: replyItem!.rpid,
parent: replyItem!.rpid,
);
replyLevel: replyLevel,
oid: replyItem!.oid,
root: replyItem!.rpid,
parent: replyItem!.rpid,
paddingTop: paddingTop);
},
).then((value) => {
// 完成评论,数据添加
@ -346,7 +347,8 @@ class ReplyItemRow extends StatelessWidget {
children: [
for (var i = 0; i < replies!.length; i++) ...[
InkWell(
onTap: () => replyReply(replyItem),
onTap: () =>
replyReply(replyItem, MediaQuery.of(context).padding.top),
child: Container(
width: double.infinity,
padding: EdgeInsets.fromLTRB(
@ -396,7 +398,8 @@ class ReplyItemRow extends StatelessWidget {
],
if (extraRow == 1)
InkWell(
onTap: () => replyReply(replyItem),
onTap: () =>
replyReply(replyItem, MediaQuery.of(context).padding.top),
child: Container(
width: double.infinity,
padding: const EdgeInsets.fromLTRB(8, 5, 8, 8),
@ -426,14 +429,14 @@ class ReplyItemRow extends StatelessWidget {
);
}
void replyReply(replyItem) {
void replyReply(replyItem, paddingTop) {
// replyItem 楼主评论
VideoDetailController videoDetailCtr =
Get.find<VideoDetailController>(tag: Get.arguments['heroTag']);
videoDetailCtr.oid = replies!.first.oid;
videoDetailCtr.fRpid = f_rpid!;
videoDetailCtr.firstFloor = replyItem;
videoDetailCtr.showReplyReplyPanel();
videoDetailCtr.showReplyReplyPanel(paddingTop);
}
}

View File

@ -12,12 +12,14 @@ class VideoReplyNewDialog extends StatefulWidget {
int? root;
String? replyLevel;
int? parent;
double? paddingTop;
VideoReplyNewDialog({
this.oid,
this.root,
this.replyLevel,
this.parent,
this.paddingTop,
});
@override
@ -97,10 +99,11 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
@override
Widget build(BuildContext context) {
print('1111111');
return Container(
height: MediaQuery.of(context).size.height -
MediaQuery.of(context).size.width * 9 / 16 -
45,
widget.paddingTop!,
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
borderRadius: const BorderRadius.only(

View File

@ -12,11 +12,14 @@ class VideoReplyReplyPanel extends StatefulWidget {
int? rpid;
Function? closePanel;
ReplyItemModel? firstFloor;
double? paddingTop;
VideoReplyReplyPanel({
this.oid,
this.rpid,
this.closePanel,
this.firstFloor,
this.paddingTop,
super.key,
});
@ -59,7 +62,9 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
@override
Widget build(BuildContext context) {
return Container(
height: Get.size.height - Get.size.width * 9 / 16 - 45,
height: MediaQuery.of(context).size.height -
MediaQuery.of(context).size.width * 9 / 16 -
widget.paddingTop!,
color: Theme.of(context).colorScheme.background,
child: Column(
children: [