如何在 flutter 中重叠这两个小部件
How to overlap these two widgets in flutter
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),
),
),
],
),
],
),
);
尝试在更大的范围内使用堆栈,也许在列之外。
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),
),
),
],
),
],
),
);
尝试在更大的范围内使用堆栈,也许在列之外。