imaNNeo / fl_chart

FL Chart is a highly customizable Flutter chart library that supports Line Chart, Bar Chart, Pie Chart, Scatter Chart, and Radar Chart.
https://flchart.dev
MIT License
6.87k stars 1.78k forks source link

The named parameter 'swapAnimationDuration' isn't defined. (has been renamed to duration) #1542

Open florianneukirchen opened 10 months ago

florianneukirchen commented 10 months ago

With recent flutter versions, passing the parameter swapAnimationDuration as explained in the documentation and in issues #684 and #109 results in an Error: The named parameter 'swapAnimationDuration' isn't defined.) .

It turns out the named parameter in ImplicitlyAnimatedWidget is (or has been renamed to?) duration.

The following code works:

LineChart(
  duration: Duration.zero,
  LineChartData(
    // Your chart data here
  ),
)

Instead of:

LineChart(
  swapAnimationDuration: Duration.zero,
  LineChartData(
    // Your chart data here
  ),
)

I am not sure whether this should be fixed in the documentation or in the code of fl_chart.

Versions Flutter 3.16.0 • channel stable • https://github.com/flutter/flutter.git Framework • revision db7ef5bf9f (vor 7 Wochen) • 2023-11-15 11:25:44 -0800 Engine • revision 74d16627b9 Tools • Dart 3.2.0 • DevTools 2.28.2

fl_chart 0.66.0

NotTsunami commented 10 months ago

There is a PR already to address this that has not been merged yet: https://github.com/imaNNeo/fl_chart/pull/1496