custom<T> method

Future<void> custom<T>({
  1. required Duration duration,
  2. required Widget builder(
    1. BuildContext context,
    2. T value,
    3. Widget child
    ),
  3. required T transformer(
    1. double value
    ),
  4. Curve curve = Curves.linear,
})

Perform custom animation.

The transformer is given a value to which curve, which varies between 0.0 and 1.0, is applied, so convert it to any value of type T.

Set up a function that takes a converted T value in builder and returns the widget to be animated.

Set the animation duration in duration.

Set the animation curve to curve.

カスタムアニメーションを行います。

transformerに0.0から1.0の間で変化するcurveを適用した値が渡されるのでT型の好きな値に変換してください。

builderに変換済みのTの値を受け取り、アニメーションの対象となるウィジェットを返す関数を設定します。

durationにアニメーションの時間を設定します。

curveにアニメーションのカーブを設定します。

Implementation

Future<void> custom<T>({
  required Duration duration,
  required Widget Function(BuildContext context, T value, Widget child)
      builder,
  required T Function(double value) transformer,
  Curve curve = Curves.linear,
}) {
  return runAnimateQuery(
    _CustomEffectQuery(
      duration: duration,
      curve: curve,
      builder: builder,
      transformer: transformer,
    ),
  );
}