animateTo method

Future<void> animateTo(
  1. int index, {
  2. Duration? duration,
  3. Curve? curve,
})

Implementation

Future<void> animateTo(int index,{Duration? duration,Curve? curve})async{
  double offset = index * state.widget.width;
  if (state.boardViewController != null && state.boardViewController.hasClients) {
    await state.boardViewController.animateTo(
        offset, duration: duration!, curve: curve!);
  }
}