Chart im Export

This commit is contained in:
2025-11-16 23:05:40 +01:00
parent 1f981376f6
commit 5c4acdb716
@@ -716,6 +716,11 @@ class _IgelDetailState extends ConsumerState<IgelDetailScreen> {
if (ctx == null) return null;
final boundary = ctx.findRenderObject() as RenderRepaintBoundary?;
if (boundary == null) return null;
// Ensure the chart has been painted before capturing, otherwise toImage can return empty.
if (boundary.debugNeedsPaint) {
await Future.delayed(Duration.zero);
await WidgetsBinding.instance.endOfFrame;
}
final ui.Image img = await boundary.toImage(pixelRatio: 3);
final byteData = await img.toByteData(format: ui.ImageByteFormat.png);
return byteData?.buffer.asUint8List();