big
This commit is contained in:
2026-06-28 03:16:42 +03:00
parent 1a6ad1fe27
commit 6fdf4eedf1
5 changed files with 201 additions and 76 deletions
+9 -2
View File
@@ -109,8 +109,15 @@ class CategoryCatalog {
Color colorFor(String key, [Color? fallback]) =>
byKey(key)?.color ?? fallback ?? AppColors.accent;
String labelFor(String key, bool isRu) =>
byKey(key)?.label(isRu) ?? key;
String labelFor(String key, bool isRu) {
final cat = byKey(key);
if (cat != null) return cat.label(isRu);
if (isRu) {
final ru = AppCategories.ruLabels[key];
if (ru != null) return ru;
}
return key;
}
bool hasKey(String key) => byKey(key) != null;
}