added function to format enum value names

This commit is contained in:
2025-02-11 14:41:34 +01:00
parent 17c92496a9
commit f98fabf579

6
lib/services/tools.dart Normal file
View File

@@ -0,0 +1,6 @@
String getEnumValueName<T extends Enum>(T value) {
String name =
value.name.replaceAllMapped(RegExp(r'[A-Z]'), (match) => ' ${match[0]}');
name = name[0].toUpperCase() + name.substring(1);
return name;
}