toPascalCase function

String toPascalCase(
  1. String input
)

Convert snake_case to PascalCase. Example: order_history → OrderHistory

Implementation

String toPascalCase(String input) {
  return input.split('_').map((word) {
    if (word.isEmpty) return '';
    return word[0].toUpperCase() + word.substring(1);
  }).join();
}