diff --git a/lib/services/tools.dart b/lib/services/tools.dart new file mode 100644 index 0000000..91ffde2 --- /dev/null +++ b/lib/services/tools.dart @@ -0,0 +1,6 @@ +String getEnumValueName(T value) { + String name = + value.name.replaceAllMapped(RegExp(r'[A-Z]'), (match) => ' ${match[0]}'); + name = name[0].toUpperCase() + name.substring(1); + return name; +}