snapToState method

void snapToState(
  1. GlassSheetState state, {
  2. bool animate = true,
  3. double velocity = 0,
})

Snaps the sheet to state, optionally animating the transition.

When animate is false the sheet jumps instantly. velocity seeds the spring simulation's initial velocity (pixels/second, upward positive).

Implementation

void snapToState(GlassSheetState state,
    {bool animate = true, double velocity = 0}) {
  _state?._snapToState(state, animate: animate, velocity: velocity);
}