emailValidation function Null safety

bool emailValidation(
  1. String? value
)

Implementation

bool emailValidation(String? value) {
  if (value == null || value.isEmpty) return false;
  const emailRegex =
      r'^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$';
  return RegExp(emailRegex).hasMatch(value);
}