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