toSnakeCase static method

String toSnakeCase(
  1. String text
)

Converts string to snake_case.

Implementation

static String toSnakeCase(String text) {
  final words = _splitIntoWords(text);
  return words.map((w) => w.toLowerCase()).join('_');
}