From 68004409a3a57c6e9b079474727392a60434ecf4 Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 23 Feb 2026 04:28:40 -0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=AA=E8=A1=A8=E7=9B=98=E6=A6=82?= =?UTF-8?q?=E8=A7=88=E5=8D=A1=E7=89=87=E7=AD=89=E9=AB=98=E5=AF=B9=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Row 外层包 IntrinsicHeight + CrossAxisAlignment.stretch,三卡自动等高 - Loading/Error 卡片去掉固定 height:140,改为 padding + stretch 拉伸 Co-Authored-By: Claude Opus 4.6 --- .../presentation/pages/dashboard_page.dart | 59 +++++++++---------- 1 file changed, 27 insertions(+), 32 deletions(-) diff --git a/it0_app/lib/features/dashboard/presentation/pages/dashboard_page.dart b/it0_app/lib/features/dashboard/presentation/pages/dashboard_page.dart index a3c2cda..75b3aa9 100644 --- a/it0_app/lib/features/dashboard/presentation/pages/dashboard_page.dart +++ b/it0_app/lib/features/dashboard/presentation/pages/dashboard_page.dart @@ -165,17 +165,17 @@ class DashboardPage extends ConsumerWidget { style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), ), const SizedBox(height: 12), - Row( - children: [ - // Server card - Expanded(child: _buildServerCard(serverAsync)), - const SizedBox(width: 12), - // Alert card - Expanded(child: _buildAlertCard(alertAsync)), - const SizedBox(width: 12), - // Tasks card - Expanded(child: _buildTasksCard(recentOpsAsync)), - ], + IntrinsicHeight( + child: Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Expanded(child: _buildServerCard(serverAsync)), + const SizedBox(width: 12), + Expanded(child: _buildAlertCard(alertAsync)), + const SizedBox(width: 12), + Expanded(child: _buildTasksCard(recentOpsAsync)), + ], + ), ), const SizedBox(height: 24), // ------------- Recent operations -------------------------------- @@ -399,8 +399,8 @@ class _SummaryCardLoading extends StatelessWidget { Widget build(BuildContext context) { return const Card( color: AppColors.surface, - child: SizedBox( - height: 140, + child: Padding( + padding: EdgeInsets.all(14), child: Center(child: CircularProgressIndicator(strokeWidth: 2)), ), ); @@ -415,26 +415,21 @@ class _SummaryCardError extends StatelessWidget { Widget build(BuildContext context) { return Card( color: AppColors.surface, - child: SizedBox( - height: 140, - child: Center( - child: Padding( - padding: const EdgeInsets.all(12), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Icon(Icons.error_outline, color: AppColors.error, size: 28), - const SizedBox(height: 6), - Text( - message, - style: const TextStyle(color: AppColors.error, fontSize: 11), - textAlign: TextAlign.center, - maxLines: 3, - overflow: TextOverflow.ellipsis, - ), - ], + child: Padding( + padding: const EdgeInsets.all(14), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon(Icons.error_outline, color: AppColors.error, size: 28), + const SizedBox(height: 6), + Text( + message, + style: const TextStyle(color: AppColors.error, fontSize: 11), + textAlign: TextAlign.center, + maxLines: 3, + overflow: TextOverflow.ellipsis, ), - ), + ], ), ), );