我想使容器隐藏溢出

问题描述 投票:0回答:1

我有一个图像,然后通过转换对其进行缩放,然后将其放置到容器中,并且我希望结果是容器将以图像高度溢出

这是代码

Container(
  child: Transform.scale(
  scale: 1.8,
  child: Image(
    image: AssetImage("lib/assets/images/example.jpeg"),
  ),
 ),
)

this is the result

and this is what i want

flutter flutter-layout
1个回答
0
投票
Container(
        width: MediaQuery.of(context).size.width,
 height: MediaQuery.of(context).size.height*0.5,
  child: Transform.scale(
  scale: 1.8,
  child: Image(
    image: AssetImage("lib/assets/images/example.jpeg"),
  ),
 ),
)
© www.soinside.com 2019 - 2024. All rights reserved.