flutter - 如何让 Stack 的一个元素出现在另一个元素之外?
问题描述
这是视觉上解释的问题我正在尝试使用 Stack 小部件将文本小部件堆叠在放置在中心的圆形头像上。当我尝试使用 Positioned 小部件将其放置在圆形 Avatar 的底部和右侧时,文本小部件似乎被剪裁了。
Stack(
children: <Widget>[
// circle avatar has to be on the center
CircleAvatar(
radius: 40, //making the border of circleAvatar appear amber colored
backgroundColor: Colors.amber[900],
child: CircleAvatar(
// backgroundImage:
// AssetImage('assets/images/img1.png'),
radius: 38,
),
),
// this has to be on the right near the circle avatar on the same row
Positioned(
bottom: 0,
right: 0,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text('Dummytext1'),
SizedBox(
height: 5,
width: 5,
),
Text('dummytext2')
],
),
),
]),
解决方案
推荐阅读
- ios - UINavigationView 弹出到根视图控制器问题
- php - 从 cmd 运行时,来自 WAMP 服务器的 PHP 没有看到 .htaccess 文件
- google-apps-script - 类表方法 getActiveCell、getCurrentCell、getActiveRange 无法按预期工作
- ejabberd - 如何使用 Smack Client 在 Ejabberd 中注册带内用户,特别是虚拟主机?
- javascript - 将两个代码合二为一 - 检查 url 是否存在/登录
- ios - 在谷歌地图中使用谷歌可拖动标记时用户界面没有响应
- mysql - 在多个一对多表上的 Mysql 上获取 group by 数据的问题
- laravel - Laravel 5.8 - 从采摘结果中获取值
- json - 在 SQL Server 中为我的选择查询读取 JSON 数据
- sql - (API) 如何在多个表中插入行