validateFRN static method

String? validateFRN(
  1. String? value
)

Ensures that FRN will be a 10 digit unique identifier

Implementation

static String? validateFRN(String? value) {
  if (value == null) {
    return 'Value cannot be empty';
  }

  final regex = RegExp(
    r'^[0-9]{10}$',
    caseSensitive: false,
    multiLine: false,
  );
  if (!regex.hasMatch(value)) {
    return 'Value must be a 10 digit unique identifier';
  }

  return null;
}