static String extractUrlBase(String url) { final index = url.lastIndexOf('/'); if (index == -1) return './'; return url.substring(0, index + 1); }