animateWidgetSepia method

Widget animateWidgetSepia({
  1. int delayMs = 0,
  2. int durationMs = 700,
  3. bool repeat = false,
  4. bool animate = true,
})
  1. Sepia Nostalgia

Implementation

Widget animateWidgetSepia(
    {int delayMs = 0,
    int durationMs = 700,
    bool repeat = false,
    bool animate = true}) {
  if (!animate) return this;
  return _baseAnimate(delayMs: delayMs, repeat: repeat)
      .fadeIn(duration: 400.ms)
      .custom(
        begin: 0,
        end: 1,
        duration: durationMs.ms,
        builder: (_, v, c) => ColorFiltered(
          colorFilter: ColorFilter.matrix([
            (1 - v) + (v * 0.393),
            v * 0.769,
            v * 0.189,
            0,
            0,
            v * 0.349,
            (1 - v) + (v * 0.686),
            v * 0.168,
            0,
            0,
            v * 0.272,
            v * 0.534,
            (1 - v) + (v * 0.131),
            0,
            0,
            0,
            0,
            0,
            1,
            0,
          ]),
          child: c,
        ),
      );
}