image - 在颤动中使用颜色渐变的容器顶部添加图像和后退箭头不起作用
问题描述
我正在尝试在具有背景渐变颜色的容器顶部添加图像和白色后退箭头,同时当然保留背景。这是我想要的结果:
这是我尝试过的代码:
Stack(
children: <Widget>[
Container(
height: 200,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: <Color>[Color(0xffb21fc3), Color(0xff960cd1)],
),
),
),
Image.asset(
'assets/vip_big.jpg',
colorBlendMode: BlendMode.overlay,
),
Positioned(
top: 45,
left: 15,
child: IconButton(
icon: Icon(
Icons.arrow_back_ios,
size: 45.0,
color: Colors.white,
),
onPressed: () {}),
),
],
),
这是我得到的:
我需要进行哪些更改才能获得正确的输出?
解决方案
将白色从图像替换为透明。现在,因为图像是 jpeg,所以没有透明度。因此图像与您的渐变容器重叠。
推荐阅读
- python - 除了自变量之外,如何为 scipy.optimize.minimize 的目标函数提供额外的输入
- azure-pipelines - 在 azure datafactory 管道中一一提供 azure databrick 活动中的文件名
- python - 在迭代时更改 JSON 结构
- excel-formula - 如何在 Power Pivot 中对两个查找值结果求和
- angular - 我可以在我的计算机上使用多个角度版本吗?
- symfony4 - Symfony 4,登录(或注销)后如何将用户重定向到上一页?
- sql - 如何合并我的数据以减少 MariaDB 中不同值的数量?
- java - 使用wireshark,是否可以捕获sqlprepared statement的参数?
- javascript - 如何过滤多维对象数组
- java - 更改片段更改的主题