snakeToPascalCase function

String snakeToPascalCase(
  1. String text
)

Implementation

String snakeToPascalCase(String text) {
  if(text.isEmpty) return text;
  return text
      .split('_')
      .map((word) => word[0].toUpperCase() + word.substring(1).toLowerCase())
      .join();
}