From e20caf30e93fc35965d9919ce9cccd240623464c Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Mon, 24 Nov 2025 19:39:58 +0800 Subject: [PATCH] =?UTF-8?q?style(views):=20=E8=B0=83=E6=95=B4=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E5=B0=BA=E5=AF=B8=E5=92=8C=E6=98=BE=E7=A4=BA=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改ota_upgrade_view中图片尺寸从100.h增加到120.h - 将BoxFit.cover改为BoxFit.contain以更好显示图片内容 - 移除home_view中注释掉的冗余代码 --- lib/modules/home/views/home_view.dart | 34 +------------------ .../ota_upgrade/views/ota_upgrade_view.dart | 6 ++-- 2 files changed, 4 insertions(+), 36 deletions(-) diff --git a/lib/modules/home/views/home_view.dart b/lib/modules/home/views/home_view.dart index 55122a5b6..0f7bf8fc7 100644 --- a/lib/modules/home/views/home_view.dart +++ b/lib/modules/home/views/home_view.dart @@ -212,22 +212,6 @@ class HomeView extends GetView { height: 220.h, child: PageView( children: [ - // Center( - // child: ClipRRect( - // // 添加 ClipRRect 来实现圆角 - // borderRadius: BorderRadius.circular(16.r), // 使用与其他部件一致的圆角大小 - // child: SizedBox( - // width: double.infinity, - // height: 200.h, - // child: Image.asset( - // isDarkMode - // ? 'assets/images/robot_light.png' - // : 'assets/images/robot_light.png', - // fit: BoxFit.fitWidth, - // ), - // ), - // ), - // ), Center( child: ClipRRect( // 添加 ClipRRect @@ -242,7 +226,7 @@ class HomeView extends GetView { imagePath, width: double.infinity, height: 220.h, - fit: BoxFit.cover, + fit: BoxFit.contain, errorBuilder: (context, error, stackTrace) { // 网络图片加载失败时使用默认图片 return Image.asset( @@ -287,22 +271,6 @@ class HomeView extends GetView { ), ), ), - // Center( - // child: ClipRRect( - // // 添加 ClipRRect - // borderRadius: BorderRadius.circular(16.r), - // child: SizedBox( - // width: double.infinity, - // height: 200.h, - // child: Image.asset( - // isDarkMode - // ? 'assets/images/glasses_light.png' - // : 'assets/images/glasses_light.png', - // fit: BoxFit.fitWidth, - // ), - // ), - // ), - // ), ], ), ); diff --git a/lib/modules/ota_upgrade/views/ota_upgrade_view.dart b/lib/modules/ota_upgrade/views/ota_upgrade_view.dart index 8872e9947..1bc1caf0f 100644 --- a/lib/modules/ota_upgrade/views/ota_upgrade_view.dart +++ b/lib/modules/ota_upgrade/views/ota_upgrade_view.dart @@ -208,11 +208,11 @@ class OtaUpgradeView extends GetView { return ClipRRect( borderRadius: BorderRadius.circular(16.r), child: SizedBox( - width: 100.h, - height: 100.h, + width: 120.h, + height: 120.h, child: Image.network( imagePath, - fit: BoxFit.cover, + fit: BoxFit.contain, loadingBuilder: (context, child, loadingProgress) { if (loadingProgress == null) return child; return SizedBox(