On android its works well but on IOS Uint8List have most of the 0s.
This is the function below:
`
Future captureScreenshot() async {
late Uint8List? imageBytes;
await screenshotController.capture().then((Uint8List? image) {
imageBytes = image;
print(image.toString());
}).catchError((onError) {
print(onError);
});
if (imageBytes != null) {
final tempDir = await getTemporaryDirectory();
final tempFilePath = '${tempDir.path}/temp_image.png';
final file = await File(tempFilePath).writeAsBytes(imageBytes!);
On android its works well but on IOS Uint8List have most of the 0s. This is the function below: ` Future captureScreenshot() async {
late Uint8List? imageBytes;
await screenshotController.capture().then((Uint8List? image) {
imageBytes = image;
print(image.toString());
}).catchError((onError) {
print(onError);
});
if (imageBytes != null) {
final tempDir = await getTemporaryDirectory();
final tempFilePath = '${tempDir.path}/temp_image.png';
final file = await File(tempFilePath).writeAsBytes(imageBytes!);
} `
OUTPUT: flutter: [137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 2, 238, 0, 0, 5, 54, 8, 6, 0, 0, 0, 202, 215, 51, 6, 0, 0, 0, 4, 115, 66, 73, 84, 8, 8, 8, 8, 124, 8, 100, 136, 0, 0, 32, 0, 73, 68, 65, 84, 120, 156, 236, 221, 111, 140, 172, 215, 93, 31, 240, 115, 158, 231, 153, 217, 157, 153, 93, 123, 125, 157, 56, 114, 77, 131, 136, 32, 164, 52, 198, 113, 128, 36, 34, 5, 12, 148, 226, 24, 202, 181, 95, 80, 2, 85, 222, 164, 121, 81, 136, 84, 165, 106, 211, 66, 161, 246, 181, 35, 71, 17, 18, 149, 32, 2, 57, 10, 81, 8, 188, 104, 105, 171, 86, 117, 75, 84, 16, 109, 157, 74, 80, 165, 78, 106, 252, 183, 77, 67, 29, 64, 177, 75, 28, 235, 250, 222, 187, 59, 51, 187, 51, 243, 156, 211, 23, 236, 108, 247, 222, 236, 51, 127, 118, 247, 238, 189, 235, 124, 62, 210, 106, 119, 230, 247, 60, 191, 57, 215, 119, 101, 127, 125, 116, 158, 115, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,<…>
Due to this i am unable to process the screenshot further on IOS.