1、举国哀悼,App实现整体灰度:只要在整体外面套一个 ShaderMask, 然后修改 blendMode 即可
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return ShaderMask(
child: HomePage(),
shaderCallback: (Rect bounds) {
shaderCallback: (Rect bounds) {
return LinearGradient(
colors: <Color>[Colors.grey, Colors.grey],
).createShader(bounds);
},
// blendMode: BlendMode.dst,//还是原先的颜色
blendMode: BlendMode.saturation,//整体变灰色
}
}