Flutter 实现背景高斯模糊并拦截手势

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;

  @
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值