Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 1.9 KB

handle_animations.md

File metadata and controls

33 lines (26 loc) · 1.9 KB

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 swapAnimationDuration and swapAnimationCurve properties respectively.

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

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

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