fix:增加第三方平台设置

This commit is contained in:
liyi 2025-07-24 16:17:49 +08:00
parent 26e0f4d3bb
commit 2e3bc11563
4 changed files with 132 additions and 1 deletions

View File

@ -540,6 +540,19 @@ class _LockSetPageState extends State<LockSetPage>
'lockSetInfoData': state.lockSetInfoData.value
});
})),
//
CommonItem(
leftTitel: '第三方平台'.tr,
rightTitle: '',
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.thirdPartyPlatformPage,
arguments: <String, LockSetInfoData>{
'lockSetInfoData': state.lockSetInfoData.value
});
},
),
// 广使
/* 2024-01-12 广 by DaisyWu
Obx(() => Visibility(
@ -606,7 +619,7 @@ class _LockSetPageState extends State<LockSetPage>
state.lockFeature.value.appUnlockOnline == 1,
child: otherItem(
leftTitle: '开锁时是否需联网'.tr,
isHaveLine: false,
isHaveLine: true,
rightWidget: _openLockNeedOnlineSwitch()),
),
),

View File

@ -0,0 +1,8 @@
import 'package:star_lock/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_state.dart';
class ThirdPartyPlatformLogic {
ThirdPartyPlatformState state = ThirdPartyPlatformState();
void savePlatFormSetting() {
}
}

View File

@ -0,0 +1,92 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_logic.dart';
import 'package:star_lock/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_state.dart';
import 'package:star_lock/tools/titleAppBar.dart';
class ThirdPartyPlatformPage extends StatefulWidget {
const ThirdPartyPlatformPage();
@override
State<ThirdPartyPlatformPage> createState() => _ThirdPartyPlatformPageState();
}
class _ThirdPartyPlatformPageState extends State<ThirdPartyPlatformPage> {
final ThirdPartyPlatformLogic logic = Get.put(ThirdPartyPlatformLogic());
final ThirdPartyPlatformState state =
Get.find<ThirdPartyPlatformLogic>().state;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: TitleAppBar(
barTitle: '第三方平台设置'.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
actionsList: [
TextButton(
onPressed: logic.savePlatFormSetting,
child: Text(
'保存'.tr,
style: TextStyle(
color: Colors.white,
fontSize: 24.sp,
fontWeight: FontWeight.w500,
),
),
),
],
),
body: _buildBody(),
);
}
Widget _buildBody() {
return ListView.builder(
itemCount: state.platFormSet.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
setState(() {
state.selectPlatFormIndex.value = index;
});
},
child: Container(
width: 1.sw,
padding: EdgeInsets.symmetric(
vertical: 12.h,
horizontal: 24.w,
),
decoration: BoxDecoration(
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
state.platFormSet[index],
style: TextStyle(
wordSpacing: 2.w,
),
),
Visibility(
visible: state.selectPlatFormIndex.value == index,
child: Icon(
Icons.check_circle,
color: AppColors.mainColor,
size: 30.sp,
),
),
],
),
),
);
},
shrinkWrap: true,
physics: const AlwaysScrollableScrollPhysics(),
);
}
}

View File

@ -0,0 +1,18 @@
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
class ThirdPartyPlatformState {
ThirdPartyPlatformState() {
final map = Get.arguments;
lockSetInfoData.value = map['lockSetInfoData'];
}
Rx<LockSetInfoData> lockSetInfoData = LockSetInfoData().obs;
// UI
final RxList<String> platFormSet = List.of({
'涂鸦智能'.tr,
}).obs;
RxInt selectPlatFormIndex = 999.obs;
}