From fe2a6ec00619520228e342ba9e97d23d99e86588 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Wed, 9 Apr 2025 15:32:42 +0800 Subject: [PATCH] opt: more panel Signed-off-by: bggRGjQaUbCoE --- lib/pages/dynamics/widgets/author_panel.dart | 6 +++++- lib/pages/dynamics/widgets/author_panel_grpc.dart | 8 ++++++-- lib/pages/setting/pages/play_speed_set.dart | 5 +++++ lib/pages/video/detail/reply/widgets/reply_item.dart | 8 ++++++-- lib/pages/video/detail/reply/widgets/reply_item_grpc.dart | 8 ++++++-- 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/lib/pages/dynamics/widgets/author_panel.dart b/lib/pages/dynamics/widgets/author_panel.dart index edecdf30..c1fc54f6 100644 --- a/lib/pages/dynamics/widgets/author_panel.dart +++ b/lib/pages/dynamics/widgets/author_panel.dart @@ -1,3 +1,5 @@ +import 'dart:math'; + import 'package:PiliPlus/common/widgets/report.dart'; import 'package:PiliPlus/common/widgets/save_panel.dart'; import 'package:PiliPlus/http/index.dart'; @@ -219,8 +221,10 @@ class AuthorPanel extends StatelessWidget { onPressed: () { showModalBottomSheet( context: context, - useRootNavigator: true, isScrollControlled: true, + constraints: BoxConstraints( + maxWidth: min(640, min(Get.width, Get.height)), + ), builder: (context) { return morePanel(context); }, diff --git a/lib/pages/dynamics/widgets/author_panel_grpc.dart b/lib/pages/dynamics/widgets/author_panel_grpc.dart index 34329448..f0c92f17 100644 --- a/lib/pages/dynamics/widgets/author_panel_grpc.dart +++ b/lib/pages/dynamics/widgets/author_panel_grpc.dart @@ -1,3 +1,5 @@ +import 'dart:math'; + import 'package:PiliPlus/grpc/app/dynamic/v2/dynamic.pb.dart' as dyn; import 'package:PiliPlus/utils/extension.dart'; import 'package:PiliPlus/utils/storage.dart'; @@ -129,8 +131,10 @@ class AuthorPanelGrpc extends StatelessWidget { onPressed: () { showModalBottomSheet( context: context, - useRootNavigator: true, isScrollControlled: true, + constraints: BoxConstraints( + maxWidth: min(640, min(Get.width, Get.height)), + ), builder: (context) { return MorePanel( item: item, @@ -168,7 +172,7 @@ class MorePanel extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ InkWell( - onTap: () => Get.back(), + onTap: Get.back, borderRadius: const BorderRadius.only( topLeft: Radius.circular(28), topRight: Radius.circular(28), diff --git a/lib/pages/setting/pages/play_speed_set.dart b/lib/pages/setting/pages/play_speed_set.dart index d93803e1..51330c42 100644 --- a/lib/pages/setting/pages/play_speed_set.dart +++ b/lib/pages/setting/pages/play_speed_set.dart @@ -1,3 +1,5 @@ +import 'dart:math'; + import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; @@ -134,6 +136,9 @@ class _PlaySpeedPageState extends State { isScrollControlled: true, clipBehavior: Clip.hardEdge, backgroundColor: Theme.of(context).colorScheme.surface, + constraints: BoxConstraints( + maxWidth: min(640, min(Get.width, Get.height)), + ), builder: (context) { return MediaQuery.removePadding( context: context, diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index 30356300..7a707a0f 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -72,8 +72,10 @@ class ReplyItem extends StatelessWidget { feedBack(); showModalBottomSheet( context: context, - useRootNavigator: true, isScrollControlled: true, + constraints: BoxConstraints( + maxWidth: min(640, min(Get.width, Get.height)), + ), builder: (context) { return morePanel( context: context, @@ -498,8 +500,10 @@ class ReplyItem extends StatelessWidget { feedBack(); showModalBottomSheet( context: context, - useRootNavigator: true, isScrollControlled: true, + constraints: BoxConstraints( + maxWidth: min(640, min(Get.width, Get.height)), + ), builder: (context) { return morePanel( context: context, diff --git a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart index 08b329b5..65db81e8 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart @@ -79,8 +79,10 @@ class ReplyItemGrpc extends StatelessWidget { // ); showModalBottomSheet( context: context, - useRootNavigator: true, isScrollControlled: true, + constraints: BoxConstraints( + maxWidth: min(640, min(Get.width, Get.height)), + ), builder: (context) { return morePanel( context: context, @@ -532,8 +534,10 @@ class ReplyItemGrpc extends StatelessWidget { feedBack(); showModalBottomSheet( context: context, - useRootNavigator: true, isScrollControlled: true, + constraints: BoxConstraints( + maxWidth: min(640, min(Get.width, Get.height)), + ), builder: (context) { return morePanel( context: context,