feat: 优化设备配对UI展示

This commit is contained in:
wuyaxi 2025-07-17 17:11:54 +08:00
parent 1a97c428bc
commit 87bc982707

View File

@ -71,7 +71,10 @@ class _NearbyLockPageState extends State<NearbyLockPage> with RouteAware {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
// //
ConstrainedBox( Expanded(
child: Align(
alignment: Alignment.centerLeft,
child: ConstrainedBox(
constraints: BoxConstraints(maxWidth: maxWidth), constraints: BoxConstraints(maxWidth: maxWidth),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
@ -114,11 +117,14 @@ class _NearbyLockPageState extends State<NearbyLockPage> with RouteAware {
), ),
), ),
), ),
// ),
if (showRight) SizedBox(width: 12.w), ),
// //
if (showRight) if (showRight)
ConstrainedBox( Expanded(
child: Align(
alignment: Alignment.centerRight,
child: ConstrainedBox(
constraints: BoxConstraints(maxWidth: maxWidth), constraints: BoxConstraints(maxWidth: maxWidth),
child: TextButton( child: TextButton(
onPressed: () async { onPressed: () async {
@ -141,7 +147,9 @@ class _NearbyLockPageState extends State<NearbyLockPage> with RouteAware {
elevation: 2, elevation: 2,
), ),
child: Text( child: Text(
state.otaState.value ? '点击返回设备配对'.tr : '无法连接?尝试升级'.tr, state.otaState.value
? '点击返回设备配对'.tr
: '无法连接?尝试升级'.tr,
style: TextStyle(fontSize: 22.sp), style: TextStyle(fontSize: 22.sp),
maxLines: 3, maxLines: 3,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
@ -149,6 +157,8 @@ class _NearbyLockPageState extends State<NearbyLockPage> with RouteAware {
), ),
), ),
), ),
),
),
], ],
); );
}), }),