From 97418e11d45d6ce22b018ddd954d556f8fa11b92 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Thu, 5 Feb 2026 14:40:55 +0300 Subject: [PATCH] feat: update add product modal to reflect selection state with icons --- .../diary/presentation/widgets/add_product_modal.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/features/diary/presentation/widgets/add_product_modal.dart b/lib/features/diary/presentation/widgets/add_product_modal.dart index c3d9067d..a0895bf9 100644 --- a/lib/features/diary/presentation/widgets/add_product_modal.dart +++ b/lib/features/diary/presentation/widgets/add_product_modal.dart @@ -132,7 +132,12 @@ class _AddProductModalState extends State { subtitle: glossariesList[i].grInPortion == 0 ? null : Text('${glossariesList[i].grInPortion} г', style: TextStyle(height: 1, color: Colors.grey.shade600)), - trailing: Icon(Icons.add_rounded, color: Colors.grey.shade400), + trailing: Icon( + productNameController.text.trim().toLowerCase() == glossariesList[i].name.toLowerCase() + ? Icons.radio_button_checked + : Icons.radio_button_off, + color: Colors.blueAccent, + ), contentPadding: const EdgeInsets.only(left: 12), ); }, @@ -166,7 +171,9 @@ class _AddProductModalState extends State { InkWell( onTap: () { // Автоматически выбираем первый элемент, если текст точно совпадает - if (selectedGlossary == null && glossariesList.isNotEmpty && productNameController.text.trim().toLowerCase() == glossariesList[0].name.toLowerCase()) { + if (selectedGlossary == null && + glossariesList.isNotEmpty && + productNameController.text.trim().toLowerCase() == glossariesList[0].name.toLowerCase()) { selectedGlossary = glossariesList[0]; }