-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pie chart swapping data causes render box exception if animation enabled #829
Comments
The exception goes away when I set from my testing it occur often when there is not enough items in the pie (either current or the one that animating from) this seem silly how do I get around this? |
+1, same |
I need a reproducible code to work on it. |
As for myself it is happening when I'm rendering the view because of a new state.
@shababhsiddique solutions works, but sadly removes the animation :( |
I have a simple donut chart with data changed from provider on demand. When I do swap it gives a render exception.
The following assertion was thrown during a scheduler callback:
Updated layout information required for RenderLimitedBox#ebf03 NEEDS-LAYOUT NEEDS-PAINT to calculate
semantics.
'package:flutter/src/rendering/object.dart':
Failed assertion: line 2747 pos 12: '!_needsLayout'
Either the assertion indicates an error in the framework itself, or we should provide substantially
more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=2_bug.md
When the exception was thrown, this was the stack:
#2 RenderObject._getSemanticsForParent (package:flutter/src/rendering/object.dart:2747:12)
#3 RenderObject._getSemanticsForParent. (package:flutter/src/rendering/object.dart:2769:61)
#4 ContainerRenderObjectMixin.visitChildren (package:flutter/src/rendering/object.dart:3430:14)
#5 RenderObject.visitChildrenForSemantics (package:flutter/src/rendering/object.dart:2854:5)
#6 RenderObject._getSemanticsForParent (package:flutter/src/rendering/object.dart:2764:5)
#7 RenderObject._getSemanticsForParent. (package:flutter/src/rendering/object.dart:2769:61)
#8 RenderObjectWithChildMixin.visitChildren (package:flutter/src/rendering/object.dart:3146:14)
#9 RenderObject.visitChildrenForSemantics (package:flutter/src/rendering/object.dart:2854:5)
#10 RenderObject._getSemanticsForParent (package:flutter/src/rendering/object.dart:2764:5)
#11 RenderObject._getSemanticsForParent. (package:flutter/src/rendering/object.dart:2769:61)
#12 ContainerRenderObjectMixin.visitChildren (package:flutter/src/rendering/object.dart:3430:14)
#13 RenderObject.visitChildrenForSemantics (package:flutter/src/rendering/object.dart:2854:5)
#14 RenderObject._getSemanticsForParent (package:flutter/src/rendering/object.dart:2764:5)
#15 RenderObject._getSemanticsForParent. (package:flutter/src/rendering/object.dart:2769:61)
#16 RenderObjectWithChildMixin.visitChildren (package:flutter/src/rendering/object.dart:3146:14)
#17 RenderObject.visitChildrenForSemantics (package:flutter/src/rendering/object.dart:2854:5)
#18 RenderObject._getSemanticsForParent (package:flutter/src/rendering/object.dart:2764:5)
#19 RenderObject._getSemanticsForParent. (package:flutter/src/rendering/object.dart:2769:61)
#20 RenderObjectWithChildMixin.visitChildren (package:flutter/src/rendering/object.dart:3146:14)
#21 RenderObject.visitChildrenForSemantics (package:flutter/src/rendering/object.dart:2854:5)
#22 RenderObject._getSemanticsForParent (package:flutter/src/rendering/object.dart:2764:5)
#23 RenderObject._getSemanticsForParent. (package:flutter/src/rendering/object.dart:2769:61)
#24 RenderObjectWithChildMixin.visitChildren (package:flutter/src/rendering/object.dart:3146:14)
#25 RenderObject.visitChildrenForSemantics (package:flutter/src/rendering/object.dart:2854:5)
#26 RenderObject._getSemanticsForParent (package:flutter/src/rendering/object.dart:2764:5)
#27 RenderObject._getSemanticsForParent. (package:flutter/src/rendering/object.dart:2769:61)
#28 ContainerRenderObjectMixin.visitChildren (package:flutter/src/rendering/object.dart:3430:14)
#29 RenderObject.visitChildrenForSemantics (package:flutter/src/rendering/object.dart:2854:5)
#30 RenderObject._getSemanticsForParent (package:flutter/src/rendering/object.dart:2764:5)
#31 RenderObject._getSemanticsForParent. (package:flutter/src/rendering/object.dart:2769:61)
#32 RenderObjectWithChildMixin.visitChildren (package:flutter/src/rendering/object.dart:3146:14)
#33 RenderObject.visitChildrenForSemantics (package:flutter/src/rendering/object.dart:2854:5)
#34 RenderObject._getSemanticsForParent (package:flutter/src/rendering/object.dart:2764:5)
#35 RenderObject._getSemanticsForParent. (package:flutter/src/rendering/object.dart:2769:61)
#36 RenderObjectWithChildMixin.visitChildren (package:flutter/src/rendering/object.dart:3146:14)
#37 RenderObject.visitChildrenForSemantics (package:flutter/src/rendering/object.dart:2854:5)
#38 RenderObject._getSemanticsForParent (package:flutter/src/rendering/object.dart:2764:5)
#39 RenderObject._getSemanticsForParent. (package:flutter/src/rendering/object.dart:2769:61)
#40 RenderObjectWithChildMixin.visitChildren (package:flutter/src/rendering/object.dart:3146:14)
#41 RenderObject.visitChildrenForSemantics (package:flutter/src/rendering/object.dart:2854:5)
#42 RenderObject._getSemanticsForParent (package:flutter/src/rendering/object.dart:2764:5)
#43 RenderObject._updateSemantics (package:flutter/src/rendering/object.dart:2725:41)
#44 PipelineOwner.flushSemantics (package:flutter/src/rendering/object.dart:1080:16)
#45 RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:458:21)
#46 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:883:13)
#47 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:319:5)
#48 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1143:15)
#49 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1080:9)
#50 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:996:5)
#54 _invoke (dart:ui/hooks.dart:166:10)
#55 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:270:5)
#56 _drawFrame (dart:ui/hooks.dart:129:31)
(elided 5 frames from class _AssertionError and dart:async)
It renders fine visually, but this exception occur very randomly(sometime goes smoothly without exception with same data) when I switch data between income and expense
To Reproduce
Code of the pie chart
` AspectRatio(
aspectRatio: 1,
child: PieChart(
PieChartData(
borderData: FlBorderData(
show: false,
),
sectionsSpace: 0,
centerSpaceRadius: 41,
startDegreeOffset: -90,
sections: _generateSections(),
),
),
),
List _generateSections() {
List piePieces = [];
}
`
data is from provider
Versions
fl_chart: ^0.40.2
flutter: 2.5.3
The text was updated successfully, but these errors were encountered: