url static method

bool url(
  1. String string
)

Check if a string is a url.

Implementation

static bool url(String string) {
  RegExp urlRegExp = RegExp(r"http(s)?:\/\/[^\s]+");
  return urlRegExp.hasMatch(string);
}