diff --git a/lib/features/igel/presentation/igel_detail_screen.dart b/lib/features/igel/presentation/igel_detail_screen.dart index 7cfa956..aa8be1e 100644 --- a/lib/features/igel/presentation/igel_detail_screen.dart +++ b/lib/features/igel/presentation/igel_detail_screen.dart @@ -716,6 +716,11 @@ class _IgelDetailState extends ConsumerState { 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();