isUrl static method

bool isUrl(
  1. String str
)

判断是否为URL格式 Check if it is URL format

Implementation

static bool isUrl(String str) {
  return RegExp(r"^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$").hasMatch(str);
}