gpt4 book ai didi

flutter - 堆栈定位没有​​剪辑溢出

转载 作者:行者123 更新时间:2023-12-03 03:31:51 26 4
gpt4 key购买 nike

我正在尝试在图标的右下角和图片外部放置一个图标。
但是,Flutter消除了我图标的溢出。如何告诉Flutter在不重复以下堆栈宽度的两倍的情况下不裁剪图标?
换句话说,如何仅通过指定bottomright将定位的窗口小部件自由地放置在堆栈之外

Stack(
children: [
CircleAvatar(
backgroundImage: avatar1,
radius: 50.0,
),
Positioned(
bottom: -15,
right: -15,
child: CircledIconButton(
backgroundColor: Colors.grey.shade300,
icon: Icon(
Icons.photo_camera,
color: Theme.of(context).accentColor,
),
),
),
],
);
enter image description here

最佳答案

您可以添加:overflow: Overflow.visible,

Stack(
overflow: Overflow.visible,
children: [
CircleAvatar(
backgroundImage: avatar1,
radius: 50.0,
),
Positioned(
bottom: -15,
right: -15,
child: CircledIconButton(
backgroundColor: Colors.grey.shade300,
icon: Icon(
Icons.photo_camera,
color: Theme.of(context).accentColor,
),
),
),
],
);

关于flutter - 堆栈定位没有​​剪辑溢出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63457261/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com