如何重叠这两个小部件
return Scaffold(
body: Column(
children: [
Row(
children: [
Padding(
padding: EdgeInsets.only(top:screenLayout(45, context),left: screenLayout(55, context)),
child: Text('My Profile',
style: TextStyle(
fontWeight: FontWeight.bold,
color: color_mode.tertiaryColor,
letterSpacing: 1.3,
fontSize: screenLayout(43, context),
//add font later
//--//
),
),
),
],
),
verticalSpace(40, context),
Stack(
children: [
Positioned(
child: Container(
height: getHeight(context)/3,
width: getWidth(context)/1.13,
decoration: const BoxDecoration(
color: Colors.grey
),
),
),
Positioned(
left: getWidth(context)/3.7,
top: getHeight(context)/4,
child: CircleAvatar(
maxRadius: screenLayout(130, context),
),
),
],
),
],
),
);
Expected output of circle avatar and Container
Current situation, the circle avatar is not on top
return Scaffold(
body: Column(
children: [
Row(
children: [
Padding(
padding: EdgeInsets.only(top:screenLayout(45, context),left: screenLayout(55, context)),
child: Text('My Profile',
style: TextStyle(
fontWeight: FontWeight.bold,
color: color_mode.tertiaryColor,
letterSpacing: 1.3,
fontSize: screenLayout(43, context),
//add font later
//--//
),
),
),
],
),
verticalSpace(40, context),
Stack(
children: [
Positioned(
child: Container(
height: getHeight(context)/3,
width: getWidth(context)/1.13,
decoration: const BoxDecoration(
color: Colors.grey
),
),
),
Positioned(
left: getWidth(context)/3.7,
top: getHeight(context)/4,
child: CircleAvatar(
maxRadius: screenLayout(130, context),
),
),
],
),
],
),
);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试在较大的范围中使用堆栈,也许是在列之外。
Try to use stack in a bigger scope, maybe outside the column.