Added Agent Availability screen
This commit is contained in:
@@ -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]'), '');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user