motion_blur

Last updated:

0 purchases

motion_blur Image
motion_blur Images
Add to Cart

Description:

motion blur

motion_blur #
This is a package for adding motion blur to moving widgets. It supports translation and scaling blur but not rotational blur. This package uses shaders and thus will not work with platform views.
Getting started #
To use motion_blur add it as a dependency in your pubspec file:
dependencies:
motion_blur:
copied to clipboard
Then add the motion blur shader under the flutter section:
flutter:
shaders:
- packages/motion_blur/shaders/motion_blur.glsl
copied to clipboard
Usage #
To use, simply wrap the moving widget in a MotionBlur widget:
MotionBlur(
child: MovingWidget()
)
copied to clipboard
Make sure to provide enough padding in the moving widget such that the motion blur does not get cut off as the shader is not able to paint beyond the size of its child.
You can also control the intensity of the motion blur by providing a double value where 1.0 is exact interpolation between a frame and the previous frame:
MotionBlur(
intensity:1.5,
child: MovingWidget()
)
copied to clipboard
Additional information #
Unfortunately due to an issue in CanvasKit the performance on web is currently quite suboptimal. Performance can be improved by only using motion blur with small widgets and adding --dart-define=BROWSER_IMAGE_DECODING_ENABLED=false to your build command.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.