skip to Main Content

I’m using the Syncfusion Chart in my Flutter application, and everything was working fine until I upgraded Flutter to the latest version. Now, I’m encountering the following error during debugging:

Error (Xcode): ../../.pub-cache/hosted/pub.dev/syncfusion_flutter_charts-25.2.6/lib/src/charts/cartesian_chart.dart:1367:22: Error: The method ‘markNeedsBuild’ isn’t defined for the class

I tried the following approaches to resolve the issue:

Cleaning the Flutter build: I ran flutter clean to remove any old build artifacts, followed by flutter pub get to fetch the latest dependencies. I expected this to resolve any potential build issues caused by cached files.
Updating the Syncfusion Chart package: I checked if there was a newer version of the syncfusion_flutter_charts package available and updated it accordingly. I expected that the latest version might have fixes for compatibility with the latest Flutter version.
Running flutter pub get: After upgrading Flutter, I ensured that all dependencies were properly updated by running flutter pub get. I expected this to sync all dependencies with their latest compatible versions.
Checking Flutter and Dart versions: I verified that my Flutter and Dart SDKs were up-to-date and compatible with the dependencies in my pubspec.yaml.
Despite these efforts, the error persists. I expected these steps to resolve any compatibility or caching issues that might be causing the markNeedsBuild method not to be found.

2

Answers


  1. You can check this links:

    Link1

    Link2

    Link3

    Login or Signup to reply.
  2. You can add this to your pubspec.yaml file

    syncfusion_flutter_charts:
        git:
          url: https://github.com/Luvti/flutter-widgets
          path: packages/syncfusion_flutter_charts
          ref: 15e3c4a95e3cf2e2393755bf5aa11c0206ed6dea #flutter/3.24
    

    credits goes to: Luvti

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