s with every run of whitespace (newlines included) collapsed to one space, for labels shown on a single output line.
s
String oneLineLabel(String s) => s.replaceAll(RegExp(r'\s+'), ' ').trim();