The named parameter 'swapAnimationDuration' isn't defined. (has been renamed to duration)
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
There is a PR already to address this that has not been merged yet: https://github.com/imaNNeo/fl_chart/pull/1496