cake_wallet/tool/utils/utils.dart

13 lines
435 B
Dart
Raw Normal View History

import 'package:intl/intl.dart';
String normalizeKeyName(String key) {
final parts = key.split('_');
final firstWord = parts.removeAt(0);
final capitalized = parts
.map((e) => toBeginningOfSentenceCase(e))
2022-10-12 17:09:57 +00:00
.fold('', (String acc, String? word) => acc + (word ?? ''));
return firstWord + capitalized;
}
String generateConst(String name, Map<String, dynamic> config) =>
'const $name = \'${config["$name"]}\';\n';