toPascalCase function

String toPascalCase(
  1. String input
)

Converts snake_case → PascalCase

Implementation

String toPascalCase(String input) {
  return input
      .split('_')
      .where((e) => e.isNotEmpty)
      .map((e) => e[0].toUpperCase() + e.substring(1))
      .join();
}