I'm trying to blend multiple widgets under a specific widget in a Stack. For example, in this Stack...
Stack(
children: [
Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('images/desert.jpg'))),
),
Center(
child: Text('Hello, World',
style: TextStyle(fontSize: 40, color: Colors.white)))
],
),
...a color filter would be applied to the Container in the shape of the Text.
The above code produces this:
I'm trying to achieve something similar to this:
In this case, the Text changes the color of the widgets below based on a specific BlendMode (ex. difference, exclude, multiply, divide).
Another user on stack overflow asked a question (unanswered) which is similar to what I'm looking for where two widgets are blended into each other.
Is it possible to achieve a similar effect using Flutter (using CustomPainter or otherwise)? Most widgets that alter the color and properties of widgets only affect their children (ColorFiltered, ShaderMask) and the only widget I can think of that affects the widgets under it in a Stack is the BackdropFilter.
And can it work between any widget?