fix:增加第三方平台设置
This commit is contained in:
parent
26e0f4d3bb
commit
2e3bc11563
@ -540,6 +540,19 @@ class _LockSetPageState extends State<LockSetPage>
|
|||||||
'lockSetInfoData': state.lockSetInfoData.value
|
'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
|
/* 2024-01-12 会议确定去掉“蓝牙广播” by DaisyWu
|
||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
@ -606,7 +619,7 @@ class _LockSetPageState extends State<LockSetPage>
|
|||||||
state.lockFeature.value.appUnlockOnline == 1,
|
state.lockFeature.value.appUnlockOnline == 1,
|
||||||
child: otherItem(
|
child: otherItem(
|
||||||
leftTitle: '开锁时是否需联网'.tr,
|
leftTitle: '开锁时是否需联网'.tr,
|
||||||
isHaveLine: false,
|
isHaveLine: true,
|
||||||
rightWidget: _openLockNeedOnlineSwitch()),
|
rightWidget: _openLockNeedOnlineSwitch()),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -0,0 +1,8 @@
|
|||||||
|
import 'package:star_lock/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_state.dart';
|
||||||
|
|
||||||
|
class ThirdPartyPlatformLogic {
|
||||||
|
ThirdPartyPlatformState state = ThirdPartyPlatformState();
|
||||||
|
|
||||||
|
void savePlatFormSetting() {
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user