How to apply blur effect only outside of a widget?

时间:2018-08-22 13:50:33

标签: image dart flutter

I am trying to create a ui for cropping images. I want to apply blur effect outside of the selection area.

blur

In the picture above, area 1 is the selection area. I want to make it centered when this ui initialized. Then user resizes and moves it on the image. And I will use the latest location and size to crop the image.

Is there any way to achieve this by using widgets? I did this with canvas but I would do it with widgets if it's possible.

1 个答案:

答案 0 :(得分:0)

我不知道您是否能够以这种方式获得“切出”的模糊效果,而无需使用您所说的画布。

如果执行此操作,则将两个Image小部件加载到Stack中,后一个模糊,而前“选择”区域具有可拖动的ClipRect即可产生您想要的效果。我在Stack中做了稍微些类似的事情,并且能够达到我的目标。