Files
fl_chart/repo_files/documentations/handle_animations.md
zypherift c7e3f36b06
Some checks failed
Code Coverage / upload (push) Has been cancelled
Gh-Pages / build (push) Has been cancelled
Code Verification / verify (push) Has been cancelled
1.0.0
2025-08-09 18:17:34 +02:00

1.8 KiB

Animations

Sample1 Sample2 Sample3
How?

We handle all animations Implicitly, This is power of the ImplicitlyAnimatedWidget, just like AnimatedContainer. It means you don't need to do anything, just change any value and the animation is handled under the hood, if you are curious about it, check the source code, reading the source code is the best way to learn things.

Properties

You can change the Duration and Curve of animation using duration and curve properties respectively.

LineChart(
  duration: Duration(milliseconds: 150),
  curve: Curves.linear,
  LineChartData(
    isShowingMainData ? sampleData1() : sampleData2(),
  ),
)
How to disable

If you want to disable the animations, you can set Duration.zero as duration.

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