判断是否为URL格式 Check if it is URL format
static bool isUrl(String str) { return RegExp(r"^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$").hasMatch(str); }