Added Agent Availability screen

This commit is contained in:
2026-08-31 15:27:26 +02:00
parent e7508a4c8e
commit 0561109e3c
8 changed files with 171 additions and 30 deletions
+7 -1
View File
@@ -123,8 +123,9 @@ class JsonReader {
}
final text = raw.toString().trim().toLowerCase();
final normalized = _normalizeEnumName(text);
for (final candidate in values) {
if (nameOf(candidate).toLowerCase() == text) {
if (_normalizeEnumName(nameOf(candidate).toLowerCase()) == normalized) {
return candidate;
}
}
@@ -135,4 +136,9 @@ class JsonReader {
}
return fallback;
}
/// Removes separators so that `AC_API` also matches `acApi`.
static String _normalizeEnumName(String value) {
return value.replaceAll(RegExp(r'[^a-z0-9]'), '');
}
}