animateListSepiaTone method

Widget animateListSepiaTone({
  1. required int index,
  2. int intervalMs = 70,
  3. int durationMs = 700,
  4. bool animate = true,
})
  1. Sepia Nostalgia

Implementation

Widget animateListSepiaTone(
    {required int index,
    int intervalMs = 70,
    int durationMs = 700,
    bool animate = true}) {
  if (!animate) return this;
  return this
      .animate(delay: _getDelay(index, intervalMs).ms)
      .fadeIn(duration: 400.ms)
      .custom(
        begin: 0,
        end: 1,
        duration: durationMs.ms,
        builder: (context, value, child) {
          return ColorFiltered(
            colorFilter: ColorFilter.matrix([
              (1 - value) + (value * 0.393),
              value * 0.769,
              value * 0.189,
              0,
              0,
              value * 0.349,
              (1 - value) + (value * 0.686),
              value * 0.168,
              0,
              0,
              value * 0.272,
              value * 0.534,
              (1 - value) + (value * 0.131),
              0,
              0,
              0,
              0,
              0,
              1,
              0,
            ]),
            child: child,
          );
        },
      )
      .scale(
          begin: const Offset(1.05, 1.05),
          end: const Offset(1, 1),
          curve: Curves.easeOut);
}