initStateAndTicker method

void initStateAndTicker(
  1. AssetPickerViewerState<Asset, Path> s,
  2. TickerProvider v
)

Call when viewer is calling initState. 当预览器调用 initState 时注册 StateTickerProvider

Implementation

void initStateAndTicker(
  AssetPickerViewerState<Asset, Path> s,
  TickerProvider v,
) {
  viewerState = s;
  vsync = v;
  doubleTapAnimationController = AnimationController(
    duration: const Duration(milliseconds: 200),
    vsync: v,
  );
  doubleTapCurveAnimation = CurvedAnimation(
    parent: doubleTapAnimationController,
    curve: Curves.easeInOut,
  );
}