英文:
Can I Make A Container On One Another Small Container at main container border?
问题
我想创建这种类型的用户界面,是否可以不使用 Stack?
答案1
得分: 1
SizedBox(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height / 4,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 5),
child: Stack(alignment: Alignment.bottomCenter, children: [
Container(
margin: EdgeInsets.only(bottom: 5),
decoration: BoxDecoration(
color: Colors.blueGrey,
borderRadius: BorderRadius.circular(20)),
),
Container(
height: 15,
width: MediaQuery.of(context).size.width / 4,
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.circular(20)),
)
]),
),
)
英文:
SizedBox(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height / 4,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 5),
child: Stack(alignment: Alignment.bottomCenter, children: [
Container(
margin: EdgeInsets.only(bottom: 5),
decoration: BoxDecoration(
color: Colors.blueGrey,
borderRadius: BorderRadius.circular(20)),
),
Container(
height: 15,
width: MediaQuery.of(context).size.width / 4,
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.circular(20)),
)
]),
),
)
your problem is fixed now , use this code
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论