fl_chart icon indicating copy to clipboard operation
fl_chart copied to clipboard

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

Open florianneukirchen opened this issue 1 year ago • 1 comments

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

florianneukirchen avatar Jan 03 '24 20:01 florianneukirchen

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

NotTsunami avatar Jan 04 '24 16:01 NotTsunami