flutter 容器边缘图像抖动

kqhtkvqz  于 2023-05-19  发布在  Flutter
关注(0)|答案(2)|浏览(104)

我想把图像放在容器的边缘,在Flutter
如图所示

enxuqcxy

enxuqcxy1#

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,),
                    ),
                  ],
                ),
              ),
            )
          ],
        ),
cyvaqqii

cyvaqqii2#

使用堆栈小部件,其中堆栈的子级将是容器,图像 Package 在定位小部件中。

相关问题