emailValidate method

bool emailValidate({
  1. required String content,
})

This Method will validate your content from email Format. content Content is a Required parameter. Pass your inputed or that value which you want to compare with Email format.

Implementation

bool emailValidate({required String content}) {
    // First of all it will check length of the Content.
    return RegExp(
            r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
        .hasMatch(content);
  }