From 87bc9827074a24cd24a7b7b711540582855bffd5 Mon Sep 17 00:00:00 2001 From: wuyaxi <18682150237@163.com> Date: Thu, 17 Jul 2025 17:11:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=85=8D=E5=AF=B9UI=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../addLock/nearbyLock/nearbyLock_page.dart | 142 ++++++++++-------- 1 file changed, 76 insertions(+), 66 deletions(-) diff --git a/lib/mine/addLock/nearbyLock/nearbyLock_page.dart b/lib/mine/addLock/nearbyLock/nearbyLock_page.dart index f34374f7..29906c70 100755 --- a/lib/mine/addLock/nearbyLock/nearbyLock_page.dart +++ b/lib/mine/addLock/nearbyLock/nearbyLock_page.dart @@ -71,81 +71,91 @@ class _NearbyLockPageState extends State with RouteAware { crossAxisAlignment: CrossAxisAlignment.end, children: [ // 左侧按钮 - ConstrainedBox( - constraints: BoxConstraints(maxWidth: maxWidth), - child: GestureDetector( - onTap: () { - Get.toNamed(Routers.lockAddFaqPage); - }, - child: Container( - padding: EdgeInsets.symmetric( - horizontal: 16.w, vertical: 10.w), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(20.w), - boxShadow: const [ - BoxShadow( - color: Colors.black12, - blurRadius: 8, - offset: Offset(0, 2), + Expanded( + child: Align( + alignment: Alignment.centerLeft, + child: ConstrainedBox( + constraints: BoxConstraints(maxWidth: maxWidth), + child: GestureDetector( + onTap: () { + Get.toNamed(Routers.lockAddFaqPage); + }, + child: Container( + padding: EdgeInsets.symmetric( + horizontal: 16.w, vertical: 10.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(20.w), + boxShadow: const [ + BoxShadow( + color: Colors.black12, + blurRadius: 8, + offset: Offset(0, 2), + ), + ], ), - ], - ), - child: Wrap( - crossAxisAlignment: WrapCrossAlignment.center, - alignment: WrapAlignment.center, - children: [ - Icon(Icons.help_outline, - color: AppColors.touristColor, size: 22.w), - SizedBox(width: 6.w), - Text( - '找不到锁?点此查看。'.tr, - style: TextStyle( - color: AppColors.touristColor, - fontSize: 18.sp, - fontWeight: FontWeight.w500, - ), - maxLines: 3, - overflow: TextOverflow.ellipsis, - softWrap: true, + child: Wrap( + crossAxisAlignment: WrapCrossAlignment.center, + alignment: WrapAlignment.center, + children: [ + Icon(Icons.help_outline, + color: AppColors.touristColor, size: 22.w), + SizedBox(width: 6.w), + Text( + '找不到锁?点此查看。'.tr, + style: TextStyle( + color: AppColors.touristColor, + fontSize: 18.sp, + fontWeight: FontWeight.w500, + ), + maxLines: 3, + overflow: TextOverflow.ellipsis, + softWrap: true, + ), + ], ), - ], + ), ), ), ), ), - // 按钮间距 - if (showRight) SizedBox(width: 12.w), // 右侧按钮 if (showRight) - ConstrainedBox( - constraints: BoxConstraints(maxWidth: maxWidth), - child: TextButton( - onPressed: () async { - bool skip = false; - if (!state.otaState.value) { - skip = await Get.dialog( - const _TipDialog(), - ); - } - state.otaState.value = skip; - }, - style: TextButton.styleFrom( - padding: EdgeInsets.symmetric( - horizontal: 16.w, vertical: 10.w), - backgroundColor: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(20.w), + Expanded( + child: Align( + alignment: Alignment.centerRight, + child: ConstrainedBox( + constraints: BoxConstraints(maxWidth: maxWidth), + child: TextButton( + onPressed: () async { + bool skip = false; + if (!state.otaState.value) { + skip = await Get.dialog( + const _TipDialog(), + ); + } + state.otaState.value = skip; + }, + style: TextButton.styleFrom( + padding: EdgeInsets.symmetric( + horizontal: 16.w, vertical: 10.w), + backgroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(20.w), + ), + shadowColor: Colors.black12, + elevation: 2, + ), + child: Text( + state.otaState.value + ? '点击返回设备配对'.tr + : '无法连接?尝试升级'.tr, + style: TextStyle(fontSize: 22.sp), + maxLines: 3, + overflow: TextOverflow.ellipsis, + softWrap: true, + ), ), - shadowColor: Colors.black12, - elevation: 2, - ), - child: Text( - state.otaState.value ? '点击返回设备配对'.tr : '无法连接?尝试升级'.tr, - style: TextStyle(fontSize: 22.sp), - maxLines: 3, - overflow: TextOverflow.ellipsis, - softWrap: true, ), ), ),