flutter_animate
flutter_animate copied to clipboard
ShimmerEffect alters widget dimensions
trafficstars
Animation widget has its dimensions 1 px at the bottom and 1 px on the right side In this snipet container will be overflowed at the bottom by 1 px
Container(
height: 86,
color: Colors.red,
child: Animate(
effects: [
ShimmerEffect(
duration: 1000.ms,
color: AppColors.shimmerAnimationCollor
)
],
controller: _animationController,
onPlay: (controller) => controller.repeat(),
child: Container(
height: 86,
)
)
)
This is because ShaderMask doesn't do a particularly good job with edges, so by default ShimmerEffect adds 0.5px of padding around the widget to avoid visual artifacts.
You can disable this by setting padding: EdgeOffsets.zero.
I think I can work around this by creating a PaddedShaderMask, having it apply the padding, but return the original dimensions for layout. I'll put it on my list, but feel free to look into it in the interim.