From 559f0458215cc2340a527770861e87d602ad22db Mon Sep 17 00:00:00 2001 From: 22 <60903333+nini22P@users.noreply.github.com> Date: Wed, 24 Sep 2025 21:02:47 +0800 Subject: [PATCH] fix: popup padding --- lib/widgets/popup.dart | 90 +++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/lib/widgets/popup.dart b/lib/widgets/popup.dart index 8c0f11b..4b08ade 100644 --- a/lib/widgets/popup.dart +++ b/lib/widgets/popup.dart @@ -69,51 +69,51 @@ class Popup extends PopupRoute { alignment: direction == PopupDirection.left ? Alignment.bottomLeft : Alignment.bottomRight, - child: Padding( - padding: EdgeInsets.only( - bottom: 8, - left: direction == PopupDirection.left ? 8 : 0, - right: direction == PopupDirection.right ? 8 : 0, - ), - child: AnimatedBuilder( - animation: animation, - builder: (context, child) { - return SlideTransition( - position: Tween( - begin: direction == PopupDirection.left - ? const Offset(-1.0, 0.0) - : const Offset(1.0, 0.0), - end: Offset.zero, - ).animate( - CurvedAnimation( - parent: animation, - curve: Curves.easeInOutCubicEmphasized, - ), + child: AnimatedBuilder( + animation: animation, + builder: (context, child) { + return SlideTransition( + position: Tween( + begin: direction == PopupDirection.left + ? const Offset(-1.0, 0.0) + : const Offset(1.0, 0.0), + end: Offset.zero, + ).animate( + CurvedAnimation( + parent: animation, + curve: Curves.easeInOutCubicEmphasized, ), - child: child, - ); + ), + child: child, + ); + }, + child: Dismissible( + key: UniqueKey(), + direction: direction == PopupDirection.left + ? DismissDirection.endToStart + : DismissDirection.startToEnd, + onUpdate: (details) { + if (details.previousReached) { + _popOnce(context); + } }, - child: Dismissible( - key: UniqueKey(), - direction: direction == PopupDirection.left - ? DismissDirection.endToStart - : DismissDirection.startToEnd, - onUpdate: (details) { - if (details.previousReached) { - _popOnce(context); - } - }, - child: LayoutBuilder( - builder: (context, constraints) { - final screenWidth = constraints.maxWidth; - final screenHeight = constraints.maxHeight; - final int size = screenWidth > 1200 - ? 3 - : screenWidth > 720 - ? 2 - : 1; + child: LayoutBuilder( + builder: (context, constraints) { + final screenWidth = constraints.maxWidth; + final screenHeight = constraints.maxHeight; + final int size = screenWidth > 1200 + ? 3 + : screenWidth > 720 + ? 2 + : 1; - return UnconstrainedBox( + return Padding( + padding: EdgeInsets.only( + bottom: 8, + left: direction == PopupDirection.left ? 8 : 0, + right: direction == PopupDirection.right ? 8 : 0, + ), + child: UnconstrainedBox( child: LimitedBox( maxWidth: screenWidth / size - 16, maxHeight: @@ -130,9 +130,9 @@ class Popup extends PopupRoute { ), ), ), - ); - }, - ), + ), + ); + }, ), ), ),