去除多余空格(保留一个) Remove extra spaces (keep one)
static String removeExtraSpace(String str) { return str.replaceAll(RegExp(r'\s+'), ' ').trim(); }