decodeImageFromFilePath function

  1. @visibleForTesting
Future<Image> decodeImageFromFilePath(
  1. String filePath
)

Implementation

@visibleForTesting
Future<Image> decodeImageFromFilePath(String filePath) async {
  final image = decodeImage(await File(filePath).readAsBytes());
  if (image == null) {
    throw Exception('Failed to decode image: $filePath');
  }
  return image;
}