validateName static method

String? validateName(
  1. String value,
  2. String label, {
  3. String? pattern,
})

Implementation

static String? validateName(
  String value,
  String label, {
  String? pattern,
}) {
  appLogsNS("validateName : $value ");

  if (value.trim().isEmpty) return '$enter $label';

  if (hasMatch(pattern: pattern ?? namePattern, value: value)) return null;

  return '$enterValid $label';
}