backdropGrayscale method
backdrop-grayscale - 背景灰度
Implementation
Widget backdropGrayscale([double amount = 1.0]) {
return ColorFiltered(
colorFilter: ColorFilter.matrix([
0.2126 + 0.7874 * (1 - amount), 0.7152 - 0.7152 * (1 - amount), 0.0722 - 0.0722 * (1 - amount), 0, 0,
0.2126 - 0.2126 * (1 - amount), 0.7152 + 0.2848 * (1 - amount), 0.0722 - 0.0722 * (1 - amount), 0, 0,
0.2126 - 0.2126 * (1 - amount), 0.7152 - 0.7152 * (1 - amount), 0.0722 + 0.9278 * (1 - amount), 0, 0,
0, 0, 0, 1, 0,
]),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 0, sigmaY: 0),
child: build(),
),
);
}