formatKey method

String formatKey(
  1. String key
)

Implementation

String formatKey(String key) {
  return key.replaceAll('_', ' ').split(' ').map((word) {
    if (word.isEmpty) return '';
    return word[0].toUpperCase() + word.substring(1);
  }).join(' ');
}