英文:
Image on the edge of container in flutter
问题
将图像放置在Flutter容器的边缘。如图所示:
答案1
得分: 0
使用一个堆栈小部件,其中堆栈的子部件将是包含容器和图像的定位小部件。
英文:
Use a stack widget where the children of the stack would be the container and the image wrapped in a positioned widget.
答案2
得分: 0
以下是您要翻译的内容:
[![演示][1]][1]
Stack(
clipBehavior: Clip.none,
children: [
Container(
height: 200,
decoration: BoxDecoration(
color: Colors.grey.shade400,
borderRadius: BorderRadius.circular(30),
),
),
Positioned(
top: 135,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Image.network(
"https://pngimg.com/uploads/mercedes/mercedes_PNG80135.png",
height: 125,
),
const SizedBox(width: 30,),
FloatingActionButton(
onPressed: (){},
backgroundColor: Colors.white,
child: const Icon(Icons.arrow_forward,color: Colors.black,),
),
],
),
),
)
],
),
[1]: https://i.stack.imgur.com/CIguk.png
英文:
Stack(
clipBehavior: Clip.none,
children: [
Container(
height: 200,
decoration: BoxDecoration(
color: Colors.grey.shade400,
borderRadius: BorderRadius.circular(30),
),
),
Positioned(
top: 135,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Image.network(
"https://pngimg.com/uploads/mercedes/mercedes_PNG80135.png",
height: 125,
),
const SizedBox(width: 30,),
FloatingActionButton(
onPressed: (){},
backgroundColor: Colors.white,
child: const Icon(Icons.arrow_forward,color: Colors.black,),
),
],
),
),
)
],
),
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论