fix:增加第三方平台设置

This commit is contained in:
liyi 2025-07-25 15:00:07 +08:00
parent f037cb3c28
commit ba2eac4cee
3 changed files with 55 additions and 33 deletions

View File

@ -1,8 +1,19 @@
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_state.dart';
import 'package:star_lock/tools/baseGetXController.dart';
class ThirdPartyPlatformLogic {
class ThirdPartyPlatformLogic extends BaseGetXController {
ThirdPartyPlatformState state = ThirdPartyPlatformState();
void savePlatFormSetting() {
// showEasyLoading();
// showToast('功能暂未开放'.tr);
// dismissEasyLoading();
}
@override
void dispose() {
dismissEasyLoading();
super.dispose();
}
}

View File

@ -5,6 +5,7 @@ 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/commonItem.dart';
import 'package:star_lock/tools/titleAppBar.dart';
class ThirdPartyPlatformPage extends StatefulWidget {
@ -48,41 +49,45 @@ class _ThirdPartyPlatformPageState extends State<ThirdPartyPlatformPage> {
return ListView.builder(
itemCount: state.platFormSet.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
// itemCount - 1
final isLastItem = index == state.platFormSet.length - 1;
// platFormSet RxList<Platform>
final platform = state.platFormSet.value[index];
return CommonItem(
leftTitel: state.platFormSet.value[index],
rightTitle: '',
isHaveLine: !isLastItem,
// 线
isHaveDirection: false,
isHaveRightWidget: true,
rightWidget: Radio<String>(
// Radio 使 id
value: platform,
// selectPlatFormIndex id
groupValue:
state.platFormSet.value[state.selectPlatFormIndex.value],
//
activeColor: AppColors.mainColor,
// Radio
onChanged: (value) {
if (value != null) {
setState(() {
// id
final newIndex =
state.platFormSet.value.indexWhere((p) => p == value);
if (newIndex != -1) {
state.selectPlatFormIndex.value = newIndex;
}
});
}
},
),
action: () {
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,

View File

@ -1,5 +1,8 @@
import 'dart:ui';
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
import 'package:star_lock/translations/app_dept.dart';
class ThirdPartyPlatformState {
ThirdPartyPlatformState() {
@ -11,8 +14,11 @@ class ThirdPartyPlatformState {
// UI
final RxList<String> platFormSet = List.of({
'锁通通'.tr,
'涂鸦智能'.tr,
}).obs;
RxInt selectPlatFormIndex = 999.obs;
RxInt selectPlatFormIndex = 0.obs;
}