更新样式

This commit is contained in:
wyf
2025-07-11 15:55:59 +08:00
parent 9fe66f0c0c
commit 1671e1a4b2
21 changed files with 273 additions and 179 deletions

View File

@@ -160,64 +160,65 @@ class _ApplyRepairPageState extends State<ApplyRepairPage> {
mainAxisSize: MainAxisSize.max,
children: [
Obx(() {
return Row(
mainAxisSize: MainAxisSize.max,
children: deviceTypeController.deviceTypeList.value
.map(
(deviceType) => CustomCard(
borderRadius:
AppConstants().button_container_radius,
onTap: () async {
repairController.device_type.value =
deviceType['type'];
repairController.repairList
.clear(); // 清空旧数据
repairController.repairList
.add({}); // 添加新数据
await bodyDeviceController
.getDeviceList(); // 等待数据加载
_updateRepairItemKeys(); // 清空后更新 keys
repairController
.updateAll(); // 手动触发更新(如果未自动更新)
},
colors: deviceType['type'] ==
repairController.device_type.value
? [
themeController.currentColor.sc1,
themeController.currentColor.sc2,
]
: [themeController.currentColor.sc5],
child: Container(
width: (MediaQuery.sizeOf(context).width *
0.284)
.rpx,
constraints: BoxConstraints(
minWidth: 213.rpx,
minHeight: 91.rpx,
),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(20.rpx),
),
child: Align(
alignment: AlignmentDirectional(0, 0),
child: Text(
deviceType[
'name'], // 假设 deviceType 有 name 字段
style: TextStyle(
letterSpacing: 0.0,
color:
themeController.currentColor.sc3,
fontSize: AppConstants()
.normal_text_fontSize,
return SingleChildScrollView(
scrollDirection: Axis.horizontal, // 横向滚动
child: Row(
mainAxisSize: MainAxisSize.min, // 设置为 min避免撑满父组件宽度
children: deviceTypeController.deviceTypeList.value
.map(
(deviceType) => CustomCard(
borderRadius:
AppConstants().button_container_radius,
onTap: () async {
repairController.device_type.value =
deviceType['type'];
repairController.repairList
.clear(); // 清空旧数据
repairController.repairList
.add({}); // 添加新数据
await bodyDeviceController
.getDeviceList(); // 等待数据加载
_updateRepairItemKeys(); // 清空后更新 keys
repairController.updateAll(); // 手动触发更新
},
colors: deviceType['type'] ==
repairController.device_type.value
? [
themeController.currentColor.sc1,
themeController.currentColor.sc2,
]
: [themeController.currentColor.sc5],
child: Container(
width: (MediaQuery.sizeOf(context).width *
0.284)
.rpx,
constraints: BoxConstraints(
minWidth: 213.rpx,
minHeight: 91.rpx,
),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(20.rpx),
),
child: Align(
alignment: AlignmentDirectional(0, 0),
child: Text(
deviceType['name'],
style: TextStyle(
letterSpacing: 0.0,
color: themeController
.currentColor.sc3,
fontSize: AppConstants()
.normal_text_fontSize,
),
),
),
),
),
),
)
.toList()
.divide(SizedBox(width: 25.rpx)),
)
.toList()
.divide(SizedBox(width: 25.rpx)),
),
);
}),
Obx(() {