static bool isUrl(String text) { final uri = Uri.tryParse(text.trim()); return uri != null && uri.hasScheme && uri.host.isNotEmpty; }