Skip to content

fix: Prevent disposed RenderObject error in chart widgets (Flutter 3.32.6+) #2396

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ahmtydn
Copy link

@ahmtydn ahmtydn commented Jul 15, 2025

This PR fixes the "A disposed RenderObject was mutated" error that occurs when disposing chart widgets in Flutter 3.32.6 and later.

  • Adds guards to ensure refresh() and markNeedsLayout() are not called after the RenderObject is disposed.
  • Prevents mutation of disposed RenderObjects in chart element widgets.
  • Resolves navigation and disposal issues with Syncfusion charts on recent Flutter versions.

Closes: #2394

Tested on Flutter 3.32.6 and confirmed the error no longer occurs when navigating away from a chart page.

Thank you!

@sfHariHaraSudhan sfHariHaraSudhan added charts Charts component open Open labels Jul 16, 2025
@kjeremy
Copy link

kjeremy commented Jul 16, 2025

This fixes the crash for me on Windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
charts Charts component open Open
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Charts regression in Flutter 3.32.6: disposed RenderObject was mutated
3 participants