String splitOnUppercase(String str) { return str.replaceAllMapped(RegExp(r"([A-Z]+)"), (match) { return ' ${match.group(1)}'; }); }