-
Notifications
You must be signed in to change notification settings - Fork 877
Open
Labels
Description
Bug description
From versions 30.1.39 (possibly earlier) to 30.2.4 (latest), we see set xAxis(RenderChartAxis? value)
(axis.dart
) receiving null
, which violates an assertion in the setter.
The following assertion was thrown while rebuilding dirty elements:
'package:syncfusion_flutter_charts/src/charts/axis/axis.dart': Failed assertion: line 3855 pos 12: 'value != null': is not true.
- When we comment out the failing assertion, the stack shows a few more places where the
!
operator is incorrectly applied to anull
value.
The following _TypeError was thrown during paint():
Null check operator used on a null value
The relevant error-causing widget was: [REDACTED]
When the exception was thrown, this was the stack:
#0 LineSeriesRenderer.onPaint (package:syncfusion_flutter_charts/src/charts/series/line_series.dart:148:24)
- Simply replacing the
!
with?
seems to resolve our issue.
I believe this is a bug in the library -- since the type RenderChartAxis?
allows null
, it should be handled by all callers which read the xAxis
property.
Please let me know if you'd like me to submit a PR which fixes the issue for us.
Steps to reproduce
Unfortunately, I cannot provide steps to reproduce.
Code sample
Unfortunately, I cannot provide a minimal code sample.
Screenshots or Video
(no screenshots/video)
Stack Traces
(see above)
On which target platforms have you observed this bug?
Windows
Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.32.8, on LMDE 6 (faye) 6.12.33+deb12-amd64, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2025.1.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2025.1)
[✓] Connected device (2 available)
[✓] Network resources