bankIfscValidator static method
bankIfscValidator to validate bank IFSC number
validator: (value) => SimpleValidations.bankIfscValidator(value, [errorMessage]),
Implementation
static String? bankIfscValidator(String? value, [String? errorMessage]) {
RegExp ifscPattern = CustomRegEx.bankifscRegex;
if (value == null || value.isEmpty) {
return errorMessage ?? 'Required';
} else if (!ifscPattern.hasMatch(value)) {
return errorMessage ?? 'Invalid IFSC code format';
}
return null;
}