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