fix:调整ios和android页面不一致的问题

This commit is contained in:
liyi 2025-07-28 10:00:56 +08:00
parent e57e7de6f7
commit a5006b28fa

View File

@ -48,7 +48,86 @@ class _SpeechLanguageSettingsPageState
),
],
),
body: _buildBody(),
body: Obx(
() => ListView(
padding: EdgeInsets.zero,
children: [
//
Container(
color: Colors.white,
child: Column(
children: List.generate(
state.soundTypeList.length,
(index) {
final isLastItem = index == state.soundTypeList.length - 1;
final soundType = state.soundTypeList.value[index];
return CommonItem(
leftTitel: soundType,
rightTitle: '',
isHaveLine: !isLastItem,
isHaveDirection: false,
isHaveRightWidget: true,
rightWidget: Radio<String>(
value: soundType,
groupValue: state.soundTypeList
.value[state.selectSoundTypeIndex.value],
activeColor: AppColors.mainColor,
onChanged: (value) {
if (value != null) {
final newIndex = state.soundTypeList.value
.indexWhere((p) => p == value);
if (newIndex != -1) {
state.selectSoundTypeIndex.value = newIndex;
}
}
},
),
action: () {
state.selectSoundTypeIndex.value = index;
},
);
},
),
),
),
SizedBox(
height: 8.h,
),
//
Container(
color: Colors.transparent,
child: Column(
children: List.generate(
state.languages.length,
(index) {
final item = state.languages[index];
return CommonItem(
leftTitel: item.langText,
rightTitle: '',
isHaveLine: true,
isHaveDirection: false,
isHaveRightWidget: true,
rightWidget:
state.selectPassthroughListIndex.value == index
? Image(
image: const AssetImage(
'images/icon_item_checked.png'),
width: 30.w,
height: 30.w,
fit: BoxFit.contain,
)
: Container(),
action: () {
state.selectPassthroughListIndex.value = index;
},
);
},
),
),
),
],
),
),
);
}
@ -57,10 +136,7 @@ class _SpeechLanguageSettingsPageState
() => SingleChildScrollView(
child: Column(
children: [
Container(
width: 1.sw,
decoration: BoxDecoration(color: Colors.white),
child: ListView.builder(
ListView.builder(
itemCount: state.soundTypeList.length,
itemBuilder: (BuildContext context, int index) {
// itemCount - 1
@ -105,12 +181,8 @@ class _SpeechLanguageSettingsPageState
);
},
shrinkWrap: true,
physics: const AlwaysScrollableScrollPhysics(),
),
),
SizedBox(
height: 8.h,
),
physics: const NeverScrollableScrollPhysics() //add this line,
),
Column(
children: _buildList(),
),