validMobNo static method

String? validMobNo({
  1. String? value,
})

Implementation

static String? validMobNo({String? value}) {
  if (value!.isEmpty) {
    return 'Please Enter your Mobile Number';
  } else if (value.trim().length != 10) {
    return 'Please Enter valid Mobile Number';
  } else if (!value.isNumericOnly) {
    return 'Please Enter valid Mobile Number';
  } else if (int.parse((value.split(''))[0]) < 6) {
    return 'Please Enter valid Mobile Number';
  }
  return null;
}