isMobileNumber static method

bool isMobileNumber(
  1. String string
)

Checks string is valid mobile number or not and return bool

eg. 7xxxxxxxxxx, 8xxxxxxxxxx, 9xxxxxxxxxx

Implementation

static bool isMobileNumber(String string) =>
    regex(string, "^([789]{1}[0-9]{9})");