toPascalCase function

String toPascalCase(
  1. String text
)

Converts snake_case text to PascalCase, e.g. user_profile becomes UserProfile.

Implementation

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