toSnakeCase method

String toSnakeCase()

Converts the string to snake_case.

Implementation

String toSnakeCase() {
  final noUpperCase = isUpperCase ? toLowerCase() : this;
  return noUpperCase._extractLowercaseComponents().join('_');
}