From 5025e67ef1b37bc9d85c88c8a3d15e6a30ca01a7 Mon Sep 17 00:00:00 2001 From: shen <> Date: Wed, 28 Oct 2026 00:20:40 -0700 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E4=BF=AE=E5=A4=8D=E5=AE=B6=E5=BA=AD?= =?UTF-8?q?=E8=8D=AF=E7=AE=B1=E5=88=86=E7=B1=BB=E6=A0=87=E7=AD=BE=E5=AD=97?= =?UTF-8?q?=E5=8F=B7=E9=97=B4=E8=B7=9D=E4=B8=8E=E6=96=87=E5=AD=97=E6=88=AA?= =?UTF-8?q?=E6=96=AD=E6=BA=A2=E5=87=BA=E9=97=AE=E9=A2=98=EF=BC=8C=E6=94=B9?= =?UTF-8?q?=E7=94=A8=E5=B9=B3=E6=BB=91=E8=87=AA=E9=80=82=E5=BA=94Pill?= =?UTF-8?q?=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/screens/medicine_cabinet_screen.dart | 51 ++++++++++++++++-------- lib/screens/medicine_edit_dialog.dart | 6 +++ 2 files changed, 41 insertions(+), 16 deletions(-) diff --git a/lib/screens/medicine_cabinet_screen.dart b/lib/screens/medicine_cabinet_screen.dart index ddb3765..f5f2fbc 100644 --- a/lib/screens/medicine_cabinet_screen.dart +++ b/lib/screens/medicine_cabinet_screen.dart @@ -333,25 +333,39 @@ class _MedicineCabinetScreenState extends State { ), onChanged: (val) => setState(() => _searchQuery = val.trim()), ), - const SizedBox(height: 8), + const SizedBox(height: 10), SingleChildScrollView( scrollDirection: Axis.horizontal, + physics: const BouncingScrollPhysics(), child: Row( children: _filters.map((f) { final selected = _selectedFilter == f; return Padding( padding: const EdgeInsets.only(right: 8), - child: ChoiceChip( - label: Text(f), - selected: selected, - selectedColor: const Color(0xFF2563EB), - labelStyle: TextStyle( - color: selected ? Colors.white : Colors.black87, - fontSize: 12, + child: InkWell( + onTap: () => setState(() => _selectedFilter = f), + borderRadius: BorderRadius.circular(20), + child: AnimatedContainer( + duration: const Duration(milliseconds: 150), + padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 8), + decoration: BoxDecoration( + color: selected ? const Color(0xFF2563EB) : const Color(0xFFF1F5F9), + borderRadius: BorderRadius.circular(20), + border: Border.all( + color: selected ? const Color(0xFF2563EB) : const Color(0xFFE2E8F0), + width: 1, + ), + ), + child: Text( + f, + style: TextStyle( + color: selected ? Colors.white : const Color(0xFF334155), + fontSize: 13, + fontWeight: selected ? FontWeight.bold : FontWeight.w500, + height: 1.2, + ), + ), ), - onSelected: (val) { - if (val) setState(() => _selectedFilter = f); - }, ), ); }).toList(), @@ -718,19 +732,24 @@ class _MedicineCabinetScreenState extends State { required Color color, }) { return Container( - padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2), + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), decoration: BoxDecoration( color: color.withValues(alpha: 0.08), - borderRadius: BorderRadius.circular(4), + borderRadius: BorderRadius.circular(6), ), child: Row( mainAxisSize: MainAxisSize.min, children: [ - Icon(icon, size: 12, color: color), - const SizedBox(width: 3), + Icon(icon, size: 13, color: color), + const SizedBox(width: 4), Text( text, - style: TextStyle(color: color, fontSize: 11, fontWeight: FontWeight.w500), + style: TextStyle( + color: color, + fontSize: 11, + fontWeight: FontWeight.w500, + height: 1.2, + ), ), ], ), diff --git a/lib/screens/medicine_edit_dialog.dart b/lib/screens/medicine_edit_dialog.dart index e9ad9d2..4dfa419 100644 --- a/lib/screens/medicine_edit_dialog.dart +++ b/lib/screens/medicine_edit_dialog.dart @@ -263,6 +263,8 @@ class _MedicineEditDialogState extends State { children: MedicineCategory.values.map((cat) { final selected = _category == cat; return ChoiceChip( + showCheckmark: false, + labelPadding: const EdgeInsets.symmetric(horizontal: 4, vertical: 2), label: Row( mainAxisSize: MainAxisSize.min, children: [ @@ -324,6 +326,8 @@ class _MedicineEditDialogState extends State { children: _commonLocations.map((loc) { final selected = _storageLocation == loc; return ChoiceChip( + showCheckmark: false, + labelPadding: const EdgeInsets.symmetric(horizontal: 4, vertical: 2), label: Text(loc), selected: selected, selectedColor: const Color(0xFF059669), @@ -350,6 +354,8 @@ class _MedicineEditDialogState extends State { children: _commonUsers.map((user) { final selected = _targetUser == user; return ChoiceChip( + showCheckmark: false, + labelPadding: const EdgeInsets.symmetric(horizontal: 4, vertical: 2), label: Text(user), selected: selected, selectedColor: const Color(0xFFD97706),