bool isUrl(String str) { final urlPattern = r'^(http|https):\/\/'; return RegExp(urlPattern, caseSensitive: false).hasMatch(str); }