validateMobile static method

bool validateMobile(
  1. String value
)

Implementation

static bool validateMobile(String value) {
   String patttern = r'(^(?:[+0]9)?[0-9]{10,12}$)';
   RegExp regExp = RegExp(patttern);
   if (value.isEmpty) {
     return false;
   }
   else if (!regExp.hasMatch(value)) {
     return false;
   }
   return true;
 }