toSnakeCase method
Implementation
String toSnakeCase() {
String output = replaceAllMapped(RegExp(r'([A-Z])'), (match) {
return '_${match.group(1)!.toLowerCase()}';
});
if (output.startsWith('_')) {
output = output.substring(1);
}
return output;
}