skip to Main Content

I’m working on a Flutter project where I’m using the syncfusion_flutter_charts package. After upgrading Flutter to version 3.2.4 and updating the syncfusion_flutter_charts package to the latest version (26.2.10), I encountered the following error:

../../../AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_charts-26.2.10/lib/src/charts/base.dart:3225:7:
Error: The method ‘markNeedsBuild’ isn’t defined for the class
‘RenderLoadingIndicator’.

  • ‘RenderLoadingIndicator’ is from ‘package:syncfusion_flutter_charts/src/charts/base.dart’ (..

It seems that the markNeedsBuild method is not recognized in the RenderLoadingIndicator class. I haven’t made any changes to the code related to this, and I’m not sure why this is happening after the upgrade.

Here are the things I’ve tried:

Cleaned the project using flutter clean and rebuilt it.

Downgraded to an earlier version of syncfusion_flutter_charts, which doesn’t throw this error, but I need the features of the latest version.

Has anyone faced a similar issue or can provide guidance on how to resolve this?

2

Answers


  1. I found this workaround really helpfull. At least until Syncfusion update their packages.

    It’s about adding two lines of code in flutter src code.

    It works well with flutter latest version 3.24 :

    https://github.com/syncfusion/flutter-widgets/issues/2008#issuecomment-2288217108

    Login or Signup to reply.
  2. Yes, latest syncfusion_flutter_charts versions are not compatible with current updates of flutter SDK.

    So you should use an earlier version of syncfusion_flutter_charts package to overcome this problem, for me this version was working fine with latest version of flutter SDK:

     syncfusion_flutter_charts: ^22.2.9 
    

    and BTW, syncfusion had added a compatibility section in their documentation referring which version of their package shall work correctly to which of flutter versions: take a look

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search