我想让容器有隐藏的溢出

时间:2019-11-13 17:30:19

标签: flutter flutter-layout

我有一个图像,然后用transform缩放它,然后我要将其放到容器中,并且我希望结果是容器将以图像高度溢出

这是代码

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

1 个答案:

答案 0 :(得分:-1)

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"),
  ),
 ),
)