如何将容器包装在除了容器本身之外的类似辉光的阴影中?

问题描述

我在图像顶部的容器中有一个登录表单。

使用BackdropFilter ImageFilter.blur,容器具有模糊效果。

我希望容器的边缘有阴影。

问题是在容器上使用BoxShadow时,模糊容器后面的图像部分也会被阴影变暗。

我希望容器的内部保持光亮(无阴影),而外部\边缘有轻微阴影。

Scaffold(
  body: SingleChildScrollView(
    child: Container(
        height: MediaQuery.of(context).size.height,width: MediaQuery.of(context).size.width,decoration: BoxDecoration(
          image: DecorationImage(
            image: _backgroundImage,fit: BoxFit.fitHeight,)
        ),child: Container(
  padding: EdgeInsets.fromLTRB(25.0,75.0,25.0,75.0),decoration: BoxDecoration(
        borderRadius: BorderRadius.all(Radius.zero),boxShadow: [
          BoxShadow(
            color: Color(0xFF000000).withAlpha(60),blurRadius: 6.0,spreadRadius: 0.0,offset: Offset(
              0.0,3.0,),// changes position of shadow
          ),]
    ),child: ClipRect(
    child: Container(
      padding: const EdgeInsets.all(50.0),child: BackdropFilter(
        filter: ImageFilter.blur(sigmaX: 20,sigmaY: 20),child: Column(
            mainAxisAlignment: MainAxisAlignment.center,crossAxisAlignment: CrossAxisAlignment.center,children: [
              TextField(
                controller: email,obscureText:false,decoration: InputDecoration(
                  border: OutlineInputBorder(),labelText: 'Email',TextField(
                controller: password,obscureText: true,labelText: 'Password',FlatButton(
                padding: EdgeInsets.all(10.0),onPressed: () {
                  //code
                }
                child: Text(
                  "Login",style: TextStyle(fontSize: 20.0),]
        ),

), ) );

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...