widgetNameValidator static method
widgetNameValidator returns null if the given widgetName
is valid.
Implementation
static String? widgetNameValidator(String? widgetName) {
if (!RegExp(r'^[a-zA-Z0-9 ]+$').hasMatch(widgetName ?? "") &&
(widgetName ?? "").isNotEmpty) {
return ("No special character allowed");
}
return (null);
}