getImageFromDisc method
- returns the Image or null if image do not exist. It takes imageName if image is in files directory or the the entire path of the image.
Implementation
Future<Image?> getImageFromDisc(
{String? imageName, String? path, BoxFit fit = BoxFit.fill}) async {
if (imageName == null || imageName.isEmpty) return null;
return Image.memory(
(await DiscData.instance
.readFileAsBytes(fileName: imageName, path: path))!,
fit: fit);
}