loadImage static method
Loads an image based on the configured conditions
Implementation
static Widget loadImage(
Map<String, dynamic> data,
ReportElement element, {
double? width,
double? height,
BoxFit? fit,
}) {
final source = element.properties['source'] as String?;
switch (source) {
case 'conditional':
return _loadConditionalImage(
data,
element,
width: width,
height: height,
fit: fit,
);
case 'field':
return _loadFieldImage(
data,
element,
width: width,
height: height,
fit: fit,
);
case 'asset':
return _loadAssetImage(element, width: width, height: height, fit: fit);
case 'url':
return _loadUrlImage(element, width: width, height: height, fit: fit);
default:
return _loadDefaultImage(width: width, height: height);
}
}