diff --git a/lib/pages/video/detail/controller.dart b/lib/pages/video/detail/controller.dart index 06ae6886..7def4799 100644 --- a/lib/pages/video/detail/controller.dart +++ b/lib/pages/video/detail/controller.dart @@ -73,7 +73,7 @@ class VideoDetailController extends GetxController queryVideoUrl(); } - showReplyReplyPanel() { + showReplyReplyPanel(paddingTop) { PersistentBottomSheetController? ctr = scaffoldKey.currentState?.showBottomSheet((BuildContext context) { return VideoReplyReplyPanel( @@ -83,6 +83,7 @@ class VideoDetailController extends GetxController fRpid = 0, }, firstFloor: firstFloor, + paddingTop: paddingTop, ); }); ctr?.closed.then((value) { diff --git a/lib/pages/video/detail/reply/view.dart b/lib/pages/video/detail/reply/view.dart index 1c038ad9..c3a5271d 100644 --- a/lib/pages/video/detail/reply/view.dart +++ b/lib/pages/video/detail/reply/view.dart @@ -122,6 +122,7 @@ class _VideoReplyPanelState extends State @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 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( diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index 390a2420..40335eba 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -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(tag: Get.arguments['heroTag']); videoDetailCtr.oid = replies!.first.oid; videoDetailCtr.fRpid = f_rpid!; videoDetailCtr.firstFloor = replyItem; - videoDetailCtr.showReplyReplyPanel(); + videoDetailCtr.showReplyReplyPanel(paddingTop); } } diff --git a/lib/pages/video/detail/replyNew/view.dart b/lib/pages/video/detail/replyNew/view.dart index f69a1d1f..53b910ff 100644 --- a/lib/pages/video/detail/replyNew/view.dart +++ b/lib/pages/video/detail/replyNew/view.dart @@ -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 @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( diff --git a/lib/pages/video/detail/replyReply/view.dart b/lib/pages/video/detail/replyReply/view.dart index 0db76e96..49662879 100644 --- a/lib/pages/video/detail/replyReply/view.dart +++ b/lib/pages/video/detail/replyReply/view.dart @@ -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 { @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: [