Set the widget as the child of a container, and add foregroundDecoration like this:
Container(
foregroundDecoration: BoxDecoration(
color: Colors.grey,
backgroundBlendMode: BlendMode.saturation,
),
child: child,
)
-- Update:
Based on this new video from flutter team, there is another widget for this.
The code is basically the same, and it is like this:
ColorFiltered(
colorFilter: ColorFilter.mode(
Colors.grey,
BlendMode.saturation,
),
child: child,
)
But I still prefer the method using Container forgroundDecoration, since container gives you more flexibilities in the same place.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…