【发布时间】:2019-06-24 11:25:56
【问题描述】:
我正在使用 CameraPreview 测量物体的高度,但问题是我无法将 cameraPreview 高度设置为全屏..
我试过定位小部件,它填满了屏幕,但图像被拉伸了。 我试过Transform Widget,但是高度没有填满全屏,空白即将到来。图像没有被拉伸。
我的代码:
final size = MediaQuery.of(context).size;
final deviceRatio = size.width / size.height;
return Stack(
children: <Widget>[
Transform.scale(
scale: controller.value.aspectRatio/deviceRatio,
child: new AspectRatio(
aspectRatio: controller.value.aspectRatio,
child: new CameraPreview(controller),
),
),);
请帮助我在没有图像拉伸的情况下安装 CameraPreview “FULLSCREEN”..
【问题讨论】:
-
看看这个。可能会有所帮助:stackoverflow.com/a/59456849/4329236
标签: android flutter flutter-layout