saveImage function
Implementation
Future<void> saveImage(
image_lib.Image image,
String path,
String name,
) async {
Uint8List bytes = image_lib.encodeJpg(image);
final fileOnDevice = File('$path/$name.jpg');
await fileOnDevice.writeAsBytes(bytes, flush: true);
}