validator method Null safety
- @override
- String? value
override
A function that must return a validation error if the provided
value
is invalid and null
otherwise.
Implementation
@override
StudentCodeValidationError? validator(String? value) {
return value?.trim().isNotEmpty == true
? null
: StudentCodeValidationError.empty;
}