From 16fb3d6606dc4968879dcd73b81b26514548da56 Mon Sep 17 00:00:00 2001 From: shen <> Date: Tue, 27 Oct 2026 17:54:32 -0700 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E9=A6=96=E9=A1=B5=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=E9=9B=BE=E5=8C=96=E6=8C=89=E9=92=AE=E5=AE=BD=E5=BA=A6=E8=AE=BE?= =?UTF-8?q?=E4=B8=BA100%=E5=85=A8=E5=AE=BD=E5=B9=B6=E5=B1=85=E4=B8=AD?= =?UTF-8?q?=E5=AF=B9=E9=BD=90=E6=96=87=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/screens/home_screen.dart | 68 +++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart index 1dcf429..8078dea 100644 --- a/lib/screens/home_screen.dart +++ b/lib/screens/home_screen.dart @@ -563,39 +563,43 @@ class _HomeScreenState extends State { const SizedBox(height: 20), - // 主行动按钮:开始雾化 / 继续后台雾化 - ElevatedButton( - onPressed: _startSession, - style: ElevatedButton.styleFrom( - backgroundColor: _sessionService.isActive ? const Color(0xFF10B981) : const Color(0xFF2563EB), - foregroundColor: Colors.white, - padding: const EdgeInsets.symmetric(vertical: 16), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), - elevation: 2, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - Icon(_sessionService.isActive ? Icons.play_arrow_rounded : Icons.play_circle_fill, size: 22), - const SizedBox(width: 8), - Flexible( - child: Text( - _sessionService.isActive - ? (_sessionService.isWaitingForNextMed - ? '两药间隔已结束:开始第二组' - : (_sessionService.isFinished - ? '雾化已完成:确认打卡' - : '继续雾化 (${_formatTime(_sessionService.remainingSeconds)})')) - : (_activeCanisters.length > 1 - ? '开始联合雾化 (万托林先行)' - : '开始吸入 ${_activeCanisters.first.name.split(" ")[0]}'), - style: const TextStyle(fontSize: 15, fontWeight: FontWeight.bold), - maxLines: 1, - overflow: TextOverflow.ellipsis, + // 主行动按钮:开始雾化 / 继续后台雾化 (加大宽度,文本居中显示) + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: _startSession, + style: ElevatedButton.styleFrom( + backgroundColor: _sessionService.isActive ? const Color(0xFF10B981) : const Color(0xFF2563EB), + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(vertical: 16), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + elevation: 2, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + Icon(_sessionService.isActive ? Icons.play_arrow_rounded : Icons.play_circle_fill, size: 22), + const SizedBox(width: 8), + Flexible( + child: Text( + _sessionService.isActive + ? (_sessionService.isWaitingForNextMed + ? '两药间隔已结束:开始第二组' + : (_sessionService.isFinished + ? '雾化已完成:确认打卡' + : '继续雾化 (${_formatTime(_sessionService.remainingSeconds)})')) + : (_activeCanisters.length > 1 + ? '开始联合雾化 (万托林先行)' + : '开始吸入 ${_activeCanisters.first.name.split(" ")[0]}'), + style: const TextStyle(fontSize: 15, fontWeight: FontWeight.bold), + textAlign: TextAlign.center, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), ), - ), - ], + ], + ), ), ),