feat: 优化设备配对UI展示

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

View File

@ -71,81 +71,91 @@ class _NearbyLockPageState extends State<NearbyLockPage> with RouteAware {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
// //
ConstrainedBox( Expanded(
constraints: BoxConstraints(maxWidth: maxWidth), child: Align(
child: GestureDetector( alignment: Alignment.centerLeft,
onTap: () { child: ConstrainedBox(
Get.toNamed(Routers.lockAddFaqPage); constraints: BoxConstraints(maxWidth: maxWidth),
}, child: GestureDetector(
child: Container( onTap: () {
padding: EdgeInsets.symmetric( Get.toNamed(Routers.lockAddFaqPage);
horizontal: 16.w, vertical: 10.w), },
decoration: BoxDecoration( child: Container(
color: Colors.white, padding: EdgeInsets.symmetric(
borderRadius: BorderRadius.circular(20.w), horizontal: 16.w, vertical: 10.w),
boxShadow: const <BoxShadow>[ decoration: BoxDecoration(
BoxShadow( color: Colors.white,
color: Colors.black12, borderRadius: BorderRadius.circular(20.w),
blurRadius: 8, boxShadow: const <BoxShadow>[
offset: Offset(0, 2), BoxShadow(
color: Colors.black12,
blurRadius: 8,
offset: Offset(0, 2),
),
],
), ),
], child: Wrap(
), crossAxisAlignment: WrapCrossAlignment.center,
child: Wrap( alignment: WrapAlignment.center,
crossAxisAlignment: WrapCrossAlignment.center, children: [
alignment: WrapAlignment.center, Icon(Icons.help_outline,
children: [ color: AppColors.touristColor, size: 22.w),
Icon(Icons.help_outline, SizedBox(width: 6.w),
color: AppColors.touristColor, size: 22.w), Text(
SizedBox(width: 6.w), '找不到锁?点此查看。'.tr,
Text( style: TextStyle(
'找不到锁?点此查看。'.tr, color: AppColors.touristColor,
style: TextStyle( fontSize: 18.sp,
color: AppColors.touristColor, fontWeight: FontWeight.w500,
fontSize: 18.sp, ),
fontWeight: FontWeight.w500, maxLines: 3,
), overflow: TextOverflow.ellipsis,
maxLines: 3, softWrap: true,
overflow: TextOverflow.ellipsis, ),
softWrap: true, ],
), ),
], ),
), ),
), ),
), ),
), ),
//
if (showRight) SizedBox(width: 12.w),
// //
if (showRight) if (showRight)
ConstrainedBox( Expanded(
constraints: BoxConstraints(maxWidth: maxWidth), child: Align(
child: TextButton( alignment: Alignment.centerRight,
onPressed: () async { child: ConstrainedBox(
bool skip = false; constraints: BoxConstraints(maxWidth: maxWidth),
if (!state.otaState.value) { child: TextButton(
skip = await Get.dialog( onPressed: () async {
const _TipDialog(), bool skip = false;
); if (!state.otaState.value) {
} skip = await Get.dialog(
state.otaState.value = skip; const _TipDialog(),
}, );
style: TextButton.styleFrom( }
padding: EdgeInsets.symmetric( state.otaState.value = skip;
horizontal: 16.w, vertical: 10.w), },
backgroundColor: Colors.white, style: TextButton.styleFrom(
shape: RoundedRectangleBorder( padding: EdgeInsets.symmetric(
borderRadius: BorderRadius.circular(20.w), 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,
), ),
), ),
), ),