Skip to content
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

[BUG] Null check operator used on a null value - version 0.30.0 #621

Closed
darkh opened this issue Mar 27, 2021 · 3 comments
Closed

[BUG] Null check operator used on a null value - version 0.30.0 #621

darkh opened this issue Mar 27, 2021 · 3 comments
Labels
bug Something isn't working Fundamental

Comments

@darkh
Copy link

darkh commented Mar 27, 2021

Describe the bug
I am using stream to rebuild the widget whenever I got new data, every time new data coming the console throw the follow error but the app not crashing and the data showing right it's just the error show in the console

this error didn't appear when I used older version it's start only when switched to flutter 2

seems the error happens on this line
childParentData.offset = badgeOffsets[counter++]! - sizeOffset;

I don't use the badge on my code

════════ Exception caught by rendering library ═════════════════════════════════
The following _CastError was thrown during performLayout():
Null check operator used on a null value

The relevant error-causing widget was
PieChart
lib/…/widgets/pie_chart.dart:72
When the exception was thrown, this was the stack
#0 RenderPieChart.performLayout
package:fl_chart/…/pie_chart/pie_chart_renderer.dart:115
#1 RenderObject._layoutWithoutResize
package:flutter/…/rendering/object.dart:1641
#2 PipelineOwner.flushLayout
package:flutter/…/rendering/object.dart:884
#3 RendererBinding.drawFrame
package:flutter/…/rendering/binding.dart:453
#4 WidgetsBinding.drawFrame
package:flutter/…/widgets/binding.dart:874
...
The following RenderObject was being processed when the exception was fired: RenderPieChart#4220f NEEDS-LAYOUT NEEDS-COMPOSITING-BITS-UPDATE
RenderObject: RenderPieChart#4220f NEEDS-LAYOUT NEEDS-COMPOSITING-BITS-UPDATE
parentData: (can use size)
constraints: BoxConstraints(w=318.9, h=318.9)
size: Size(318.9, 318.9)
child 1: RenderLimitedBox#340b0 relayoutBoundary=up1
parentData: offset=Offset(-79.4, 0.0); id=null (can use size)
constraints: BoxConstraints(0.0<=w<=318.9, 0.0<=h<=318.9)
size: Size(318.9, 318.9)
maxWidth: 0.0
maxHeight: 0.0
child: RenderConstrainedBox#3bac3 relayoutBoundary=up2
parentData: (can use size)
constraints: BoxConstraints(0.0<=w<=318.9, 0.0<=h<=318.9)
size: Size(318.9, 318.9)
additionalConstraints: BoxConstraints(biggest)
child 2: RenderLimitedBox#68375 relayoutBoundary=up1 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
parentData: offset=Offset(0.0, 0.0); id=null (can use size)
constraints: BoxConstraints(0.0<=w<=318.9, 0.0<=h<=318.9)
size: Size(318.9, 318.9)
maxWidth: 0.0
maxHeight: 0.0
child: RenderConstrainedBox#589e5 relayoutBoundary=up2 NEEDS-PAINT
parentData: (can use size)
constraints: BoxConstraints(0.0<=w<=318.9, 0.0<=h<=318.9)
size: Size(318.9, 318.9)
additionalConstraints: BoxConstraints(biggest)
════════════════════════════════════════════════════════════════════════════════

Versions

  • which version of the Flutter are you using?
    Flutter 2.0.3 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision 4d7946a68d (9 days ago) • 2021-03-18 17:24:33 -0700
    Engine • revision 3459eb2436
    Tools • Dart 2.12.2
  • which version of the FlChart are you using?
    fl_chart: ^0.30.0
@imaNNeo
Copy link
Owner

imaNNeo commented Apr 1, 2021

Hi, it should be fixed in 0.35.0.
Check it out and let me know whether it has been fixed or not.

@imaNNeo imaNNeo added bug Something isn't working Fundamental labels Apr 1, 2021
@darkh
Copy link
Author

darkh commented Apr 1, 2021

@imaNNeoFighT Hi, try it, and works fine now, no error in the console
Thank you

@darkh darkh closed this as completed Apr 1, 2021
@imaNNeo
Copy link
Owner

imaNNeo commented Apr 1, 2021

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fundamental
Projects
None yet
Development

No branches or pull requests

2 participants