invalidLabelMessage static method
Pure — matches the app's own rule exactly
(_create_sheet.dart's FilteringTextInputFormatter.deny(RegExp(r'\s'))):
whitespace only, never casing. Rejects rather than auto-hyphenating —
the label is the handle typed into keys revoke, so silently
rewriting it would make what someone typed diverge from what exists.
The suggested fix is offered, not applied.
Implementation
static String? invalidLabelMessage(String label) {
if (!RegExp(r'\s').hasMatch(label)) return null;
final suggestion = label.trim().replaceAll(RegExp(r'\s+'), '-');
return 'Label can\'t contain whitespace. Try: --name "$suggestion"';
}