validate method

  1. @override
void validate(
  1. String? newValue
)
override

Implementation

@override
void validate(String? newValue) {
  final String? _newValue = newValue;

  if (_newValue == null || _newValue.isEmpty) {
    if (isRequired) {
      throw RequiredValueException();
    } else {
      return;
    }
  }

  if (isEmail(_newValue)) {
    return;
  }

  throw InvalidValueException();
}