diff --git a/lib/views/dietary/records/add_intake_item/index.dart b/lib/views/dietary/records/add_intake_item/index.dart index 4aa1e6a..c595cde 100644 --- a/lib/views/dietary/records/add_intake_item/index.dart +++ b/lib/views/dietary/records/add_intake_item/index.dart @@ -273,7 +273,8 @@ class _AddIntakeItemState extends State length: 2, // 选项卡的数量 child: Scaffold( appBar: AppBar( - title: buildAppBarTitle(), + // z这个宽度配合下拉框的 isExpanded 可以限制下拉框的宽度 + title: SizedBox(width: 125.sp, child: buildAppBarTitle()), actions: buildAppBarActions(), bottom: TabBar( controller: _tabController, @@ -303,9 +304,13 @@ class _AddIntakeItemState extends State return ListTile( // 这里使用DropdownButton可以控制显示的大小,用DropdownMenu暂时没搞定,会挤掉子标题文字 title: SizedBox( - height: 20.sp, + height: 24.sp, child: DropdownButton( + borderRadius: BorderRadius.all(Radius.circular(10.sp)), value: dropdownValue, + isExpanded: true, + // 默认背景是白色,但我需要字体默认是白色,和appbar中其他保持一致,那么背景色改为灰色 + dropdownColor: CusColors.dropdownColor, onChanged: (CusLabel? newValue) { setState(() { // 修改下拉按钮的显示值 @@ -322,20 +327,31 @@ class _AddIntakeItemState extends State return DropdownMenuItem( 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, - )), ); } diff --git a/lib/views/dietary/reports/index.dart b/lib/views/dietary/reports/index.dart index cbc2665..0fac2f2 100644 --- a/lib/views/dietary/reports/index.dart +++ b/lib/views/dietary/reports/index.dart @@ -219,8 +219,7 @@ class _DietaryReportsState extends State { child: Scaffold( appBar: AppBar( title: Text( - // CusAL.of(context).dietaryReports, - 'Dietary Reports', + CusAL.of(context).dietaryReports, style: TextStyle(fontSize: CusFontSizes.pageTitle), ), bottom: TabBar( diff --git a/readme-merged.md b/readme-merged.md index ec7e65a..30d604e 100644 --- a/readme-merged.md +++ b/readme-merged.md @@ -155,3 +155,9 @@ - fix:修复跟练页面点击返回无暂停弹窗的问题。 - fix:修复饮食记录主页面表格模式时顶部概述部分的表格和下方餐次的表格位对齐额问题。 - refactor:重新设计了训练日志宽表,计划可以任意删除修改,动作和训练未被使用时可删除。删除的计划和训练的训练记录的关键信息依旧保存在日志宽表中。 + +### 2023-12-28 + +- fix:修正饮食记录添加摄入条目的餐次下拉按钮样式。 + +flutter build apk --split-per-abi