imageProviderFor static method
Returns an ImageProvider from URL or file path
Implementation
static ImageProvider? imageProviderFor(String path) {
if (path.isEmpty) return null;
final isUrl = path.startsWith('http://') || path.startsWith('https://');
try {
if (isUrl) return NetworkImage(path);
final f = File(path);
if (f.existsSync()) return FileImage(f);
return NetworkImage(path);
} catch (_) {
return null;
}
}