Flutter 实现背景高斯模糊并拦截手势
在flutter中可以通过一个Widget直接实现背景模糊效果:BackdropFilter
源码介绍如下(例子被我省略了,大家可以直接查看源码的时候去看一下):
/// A widget that applies a filter to the existing painted content and then
/// paints [child].
///
/// The filter will be applied to all the area within its parent or ancestor
/// widget's clip. If there's no clip, the filter will be applied to the full
/// screen.
这边是我自己写的一个简单例子供大家参考:
import 'package:flutter/material.dart';
import 'dart:ui';
import 'package:flutter/painting.dart';
class BackdropFilterPage extends StatefulWidget {
@override
_BackdropFilterPageState createState() {
// TODO: implement createState
return _BackdropFilterPageState();
}
}
class _BackdropFilterPageState extends State<BackdropFilterPage> {
bool isShow = false;
@