convertCamelcaseStringToUnderscore method

String convertCamelcaseStringToUnderscore({
  1. required String input,
})

Implementation

String convertCamelcaseStringToUnderscore({required String input}) {
  return input.replaceAllMapped(RegExp('([A-Z])'),
      (Match match) => '_${match.group(0)?.toLowerCase()}');
}