Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShimmerEffect alters widget dimensions #101

Open
ifuterman opened this issue Aug 28, 2023 · 1 comment
Open

ShimmerEffect alters widget dimensions #101

ifuterman opened this issue Aug 28, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@ifuterman
Copy link

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,
    )
 )
)
@gskinner gskinner changed the title Animation widget has its dimensions ShimmerEffect alters widget dimensions Aug 28, 2023
@gskinner
Copy link
Owner

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.

@gskinner gskinner added the enhancement New feature or request label Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants