animateWidgetScannerBeam method

Widget animateWidgetScannerBeam({
  1. Color beamColor = Colors.blueAccent,
  2. int durationMs = 2000,
  3. bool repeat = true,
  4. bool animate = true,
})
  1. Scanner Beam (QR Style)

Implementation

Widget animateWidgetScannerBeam({
  Color beamColor = Colors.blueAccent,
  int durationMs = 2000,
  bool repeat = true,
  bool animate = true,
}) {
  if (!animate) return this;
  return _baseAnimate(repeat: repeat).custom(
    duration: durationMs.ms,
    builder:
        (_, v, c) => Stack(
          children: [
            c,
            Positioned(
              top: v * 100,
              left: 0,
              right: 0,
              child: Container(
                height: 2,
                decoration: BoxDecoration(
                  boxShadow: [
                    BoxShadow(
                      color: beamColor,
                      blurRadius: 10,
                      spreadRadius: 2,
                    ),
                  ],
                ),
              ),
            ),
          ],
        ),
  );
}