-
Couldn't load subscription status.
- Fork 423
Open
Description
hi.
Recently, photos on the iPhone are getting a white background? What problem has occurred?
The codes for converting a widget to an image are as follows:
RenderRepaintBoundary? boundary =
key1.currentContext?.findRenderObject() as RenderRepaintBoundary?;
ui.Image image = await boundary!.toImage(pixelRatio: 3.0);
ByteData? byteData =
await image.toByteData(format: ui.ImageByteFormat.png);
pngBytes = byteData!.buffer.asUint8List();
imageInMemory = pngBytes;
inside.value = false;
final String dir;
if (Platform.isAndroid) {
dir = (await getExternalStorageDirectory())?.path ?? "";
} else {
dir = (await getApplicationDocumentsDirectory()).path;
}
final String fileName = "${DateTime.now().millisecondsSinceEpoch}";
final String fullPath = '$dir/$fileName.png';
File capturedFile = File(fullPath);
await capturedFile.writeAsBytes(pngBytes!);
Metadata
Metadata
Assignees
Labels
No labels