networkWithFallback static method
Creates a network image with error handling
Implementation
static Image networkWithFallback(
String src, {
Key? key,
double? width,
double? height,
Color? color,
BoxFit? fit,
String? fallback,
}) {
return Image.network(
src,
key: key,
width: width,
height: height,
color: color,
fit: fit,
errorBuilder: (context, error, stackTrace) {
return fallback != null
? Image.asset(fallback, width: width, height: height, fit: fit)
: const Icon(Icons.error);
},
);
}