Bläddra i källkod

Add a util to validate emails

Vishnu Mohandas 4 år sedan
förälder
incheckning
785481fccd
1 ändrade filer med 5 tillägg och 0 borttagningar
  1. 5 0
      lib/utils/email_util.dart

+ 5 - 0
lib/utils/email_util.dart

@@ -0,0 +1,5 @@
+bool isValidEmail(String email) {
+  return RegExp(
+          r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
+      .hasMatch(email);
+}