backdropInvert method

Widget backdropInvert([
  1. double amount = 1.0
])

backdrop-invert - 背景反转

Implementation

Widget backdropInvert([double amount = 1.0]) {
  return ColorFiltered(
    colorFilter: ColorFilter.matrix([
      1 - 2 * amount, 0, 0, 0, 255 * amount,
      0, 1 - 2 * amount, 0, 0, 255 * amount,
      0, 0, 1 - 2 * amount, 0, 255 * amount,
      0, 0, 0, 1, 0,
    ]),
    child: BackdropFilter(
      filter: ImageFilter.blur(sigmaX: 0, sigmaY: 0),
      child: build(),
    ),
  );
}