static String normalizeName(String name) { name = name.trim().replaceAll(RegExp(r'[^\w-.]+'), '_').trim(); return name; }