I just import the syncfusion_flutter_charts in my flutter project it gives me errors?
/E:/android%20studio%20setup/flutter_windows_2.10.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_charts-20.1.56/lib/src/pyramid_chart/base/pyramid_base.dart:725:37: Error: Method 'addPostFrameCallback' cannot be called on 'SchedulerBinding?' because it is potentially null.
- 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/E:/android%20studio%20setup/flutter_windows_2.10.4-stable/flutter/packages/flutter/lib/src/scheduler/binding.dart'). Try calling using ?. instead. SchedulerBinding.instance.addPostFrameCallback((_) => _refresh()); ^^^^^^^^^^^^^^^^^^^^ /E:/android%20studio%20setup/flutter_windows_2.10.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_charts-20.1.56/lib/src/funnel_chart/base/funnel_base.dart:720:35: Error: Method 'addPostFrameCallback' cannot be called on 'SchedulerBinding?' because it is potentially null.
- 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/E:/android%20studio%20setup/flutter_windows_2.10.4-stable/flutter/packages/flutter/lib/src/scheduler/binding.dart'). Try calling using ?. instead. SchedulerBinding.instance.addPostFrameCallback((_) { ^^^^^^^^^^^^^^^^^^^^ /E:/android%20studio%20setup/flutter_windows_2.10.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_charts-20.1.56/lib/src/funnel_chart/base/funnel_base.dart:732:37: Error: Method 'addPostFrameCallback' cannot be called on 'SchedulerBinding?' because it is potentially null.
- 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/E:/android%20studio%20setup/flutter_windows_2.10.4-stable/flutter/packages/flutter/lib/src/scheduler/binding.dart'). Try calling using ?. instead. SchedulerBinding.instance.addPostFrameCallback((_) => _refresh()); ^^^^^^^^^^^^^^^^^^^^ /E:/android%20studio%20setup/flutter_windows_2.10.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_core-20.1.56/lib/src/legend/legend.dart:548:39: Error: Method 'addPostFrameCallback' cannot be called on 'SchedulerBinding?' because it is potentially null.
- 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/E:/android%20studio%20setup/flutter_windows_2.10.4-stable/flutter/packages/flutter/lib/src/scheduler/binding.dart'). Try calling using ?. instead. SchedulerBinding.instance.addPostFrameCallback(
how can i used syncfusion flutter chart in my flutter project
Flutter 2.10.4 • channel stable • https://github.com/flutter/flutter.git Framework • revision c860cba910 (9 weeks ago) • 2022-03-25 00:23:12 -0500 Engine • revision 57d3bac3dd Tools • Dart 2.16.2 • DevTools 2.9.2
Hi @amirVirtuenetz ,
The issue occurs due to the Flutter latest version. We have migrated our source compatible to the latest version of Flutter. So, we suggest upgrading the Flutter version to the latest one to avoid this issue, or if you can't upgrade Flutter to the latest version use the chart(syncfusion_flutter_charts) and core(syncfusion_flutter_core) package version to 20.1.55.
syncfusion_flutter_charts: 20.1.55
syncfusion_flutter_core: 20.1.55
Thanks, Marismathan G
Thanks for your kind information I have also discussed with my colleagues,he also suggest me to upgrade the latest version of this charts
Hi @Marismathan i have update the latest release of syncfusion_flutter_charts: ^20.1.57 syncfusion_flutter_core: ^20.1.57 but the errors is same
Hi @amirVirtuenetz,
As stated earlier, please use the chart and core package version below 20.1.55 if you want to stay with the Flutter SDK version 2.10.4 or if you want to use our latest package version, please try to upgrade your Flutter SDK version to 3.0.1. It will help you to resolve your query.
syncfusion_flutter_charts: 20.1.55 syncfusion_flutter_core: 20.1.55
If you have any further queries, please get back to us.
Regards, Yuvaraj.