loadImage function
Loads an image file and returns a widget that can display it.
Implementation
Widget loadImage(File imageFile) {
if (imageFile.path.endsWith('.svg')) {
return SvgPicture.file(imageFile);
} else {
return Image.file(imageFile);
}
}