Merge pull request 'feat: update add product modal to reflect selection state with icons' (#906) from mso7nueh/eatvio_app:feat_add_product_modal into main

Reviewed-on: eatvio/eatvio_app#906
Reviewed-by: misha <misha@noreply.localhost>
This commit is contained in:
mso7nueh
2026-02-06 09:54:25 +00:00

View File

@@ -132,7 +132,12 @@ class _AddProductModalState extends State<AddProductModal> {
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<AddProductModal> {
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];
}