Flutter ImageFiltered Widget Examples

ImageFiltered is an widget which applies filter from ImageFilter class to its child. Using ImageFiltered widget, you can apply effects to images.

ImageFiltered constructor

const ImageFiltered(
{Key key,
@required ImageFilter imageFilter,
Widget child}
)

ImageFilter.blur constructor

This constructor creates an image filter that applies a Gaussian blur.

Original image
Blurred image
ImageFiltered(
            imageFilter: ImageFilter.blur(sigmaX: 2.0, sigmaY: 2.0),
            child: Image.asset("assets/nature1.jpg"),
          )

ImageFilter.matrix constructor

Creates an image filter that applies a matrix transformation.

ImageFiltered(
            imageFilter: ImageFilter.matrix(Float64List.fromList(<double>[
              1, 0.5, 0.0, 0.0,
              0.0, 1, 0.0, 0.0,
              0.0, 0.0, 1.0, 0.0,
              0.0, 0.0, 0.0, 1.0,
            ]), filterQuality: FilterQuality.high),
            child: Image.asset("assets/nature1.jpg"),
          )

Leave a Comment

Your email address will not be published. Required fields are marked *

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close