Using a Stack
which holds an Image
and a layer on top of that.
The layer on top is smaller than the Image
. It is supposed to gray out only a the part of the underlying image.
The idea is to move this greyscale filtering layer around. Which is why it has to sit in its own layer; the grayscale filter cannot be the direct parent of the Image
.
Stack(
children: [
Image.asset('bla', fit: BoxFit.contain),
Positioned( /* WILL MOVE AROUND LATER */
top: 50,
left: 50,
right: 50,
bottom: 50,
child: Colors.red.withAlpha(100), /* GRAYSCALE FILTER HERE */
)
]
)