fromKebabCaseToCamelCase method

String fromKebabCaseToCamelCase()

Transforms a kebab-case string to a camelCase one and returns it.

Implementation

String fromKebabCaseToCamelCase() {
  final parts = split('-')..removeWhere((final part) => part.isEmpty);
  final words = parts.map((final part) => part.toCapitalized()).toList();

  words.first = words.first.toLowerCase();

  return words.join();
}