Skip to content

Commit

Permalink
fix:修正饮食记录添加摄入条目的餐次下拉按钮样式
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanotsu committed Dec 28, 2023
1 parent 8c4a99b commit 9c23d19
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
34 changes: 25 additions & 9 deletions lib/views/dietary/records/add_intake_item/index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ class _AddIntakeItemState extends State<AddIntakeItem>
length: 2, // 选项卡的数量
child: Scaffold(
appBar: AppBar(
title: buildAppBarTitle(),
// z这个宽度配合下拉框的 isExpanded 可以限制下拉框的宽度
title: SizedBox(width: 125.sp, child: buildAppBarTitle()),
actions: buildAppBarActions(),
bottom: TabBar(
controller: _tabController,
Expand Down Expand Up @@ -303,9 +304,13 @@ class _AddIntakeItemState extends State<AddIntakeItem>
return ListTile(
// 这里使用DropdownButton可以控制显示的大小,用DropdownMenu暂时没搞定,会挤掉子标题文字
title: SizedBox(
height: 20.sp,
height: 24.sp,
child: DropdownButton<CusLabel>(
borderRadius: BorderRadius.all(Radius.circular(10.sp)),
value: dropdownValue,
isExpanded: true,
// 默认背景是白色,但我需要字体默认是白色,和appbar中其他保持一致,那么背景色改为灰色
dropdownColor: CusColors.dropdownColor,
onChanged: (CusLabel? newValue) {
setState(() {
// 修改下拉按钮的显示值
Expand All @@ -322,20 +327,31 @@ class _AddIntakeItemState extends State<AddIntakeItem>
return DropdownMenuItem<CusLabel>(
value: value,
child: Text(
showCusLableMapLabel(context, value),
style: TextStyle(fontSize: CusFontSizes.itemTitle),
showCusLable(value),
style: TextStyle(
color: Colors.white,
fontSize: CusFontSizes.pageSubTitle,
),
),
);
},
).toList(),
underline: Container(), // 将下划线设置为空的Container
icon: null, // 将图标设置为null
// icon: null, // 将图标设置为null
icon: Icon(
Icons.arrow_drop_down,
size: CusIconSizes.iconNormal,
color: Colors.white,
),
),
),
subtitle: Text(
currentDate,
style: TextStyle(
color: Colors.white,
fontSize: CusFontSizes.itemContent,
),
),
subtitle: Text(currentDate,
style: TextStyle(
fontSize: CusFontSizes.itemSubTitle,
)),
);
}

Expand Down
3 changes: 1 addition & 2 deletions lib/views/dietary/reports/index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,7 @@ class _DietaryReportsState extends State<DietaryReports> {
child: Scaffold(
appBar: AppBar(
title: Text(
// CusAL.of(context).dietaryReports,
'Dietary Reports',
CusAL.of(context).dietaryReports,
style: TextStyle(fontSize: CusFontSizes.pageTitle),
),
bottom: TabBar(
Expand Down
6 changes: 6 additions & 0 deletions readme-merged.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,9 @@
- fix:修复跟练页面点击返回无暂停弹窗的问题。
- fix:修复饮食记录主页面表格模式时顶部概述部分的表格和下方餐次的表格位对齐额问题。
- refactor:重新设计了训练日志宽表,计划可以任意删除修改,动作和训练未被使用时可删除。删除的计划和训练的训练记录的关键信息依旧保存在日志宽表中。

### 2023-12-28

- fix:修正饮食记录添加摄入条目的餐次下拉按钮样式。

flutter build apk --split-per-abi

0 comments on commit 9c23d19

Please sign in to comment.