cropImage function
Implementation
Future<Uint8List> cropImage(String path, int x, int y, int w, int h) async {
Uint8List imageBytes = await File(path).readAsBytes();
Image croppedImage = copyCrop(decodeImage(imageBytes)!, x, y, w, h);
List<int> croppedList = encodePng(croppedImage);
Uint8List croppedBytes = Uint8List.fromList(croppedList);
// File savedImage = await File("/0").writeAsBytes(croppedBytes);
return croppedBytes;
}