Support named alert config

This commit is contained in:
2024-08-15 22:50:00 +08:00
parent 22b863f2bf
commit cfa61e1a8a
7 changed files with 34 additions and 11 deletions

View File

@@ -60,13 +60,13 @@ class AlertDetectResultDialog extends StatelessWidget {
title: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(item.name),
Text(item.config.name),
const SizedBox(width: 6),
Badge(label: Text('#${item.config.nutrientId}'))
],
),
subtitle: Text(
'${item.current ?? 'undetected'.tr} ${(item.difference ?? 0) > 0 ? '' : ''}${item.difference?.abs().toPrecision(2) ?? '-'} ${item.unitName ?? ''}',
'${item.nutrient?.value ?? 'undetected'.tr} ${(item.difference ?? 0) > 0 ? '' : ''}${item.difference?.abs().toPrecision(2) ?? '-'} ${item.unitName ?? ''}',
),
);
},