Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 颤振中的本机设备定向问题_Flutter_Dart_Orientation_Landscape_Portrait - Fatal编程技术网

Flutter 颤振中的本机设备定向问题

Flutter 颤振中的本机设备定向问题,flutter,dart,orientation,landscape,portrait,Flutter,Dart,Orientation,Landscape,Portrait,我在用颤振,我在用 我试图知道设备的方向,并以此为基础管理我的视图 该插件工作得非常好,但当我在A页面上时发现了一个问题,该页面有一个NativeDeviceOrientationReader,然后转到B页面,该页面有另一个NativeDeviceOrientationReader 这种情况下,页面应该有一个 NoDeDebug定位。GealPoeleFET会有 No.Devices定位。 注意:如果在更改页面后旋转手机,手机将开始正常工作。 另外,如果我删除一个NativeDeviceOrie

我在用颤振,我在用

我试图知道设备的方向,并以此为基础管理我的视图

该插件工作得非常好,但当我在
A
页面上时发现了一个问题,该页面有一个
NativeDeviceOrientationReader
,然后转到
B
页面,该页面有另一个
NativeDeviceOrientationReader

这种情况下,页面应该有一个<代码> NoDeDebug定位。GealPoeleFET会有<代码> No.Devices定位。 注意:如果在更改页面后旋转手机,手机将开始正常工作。 另外,如果我删除一个NativeDeviceOrientationReader的,它也可以正常工作

我正在使用以下代码:

NativeDeviceOrientationReader(
生成器:(上下文){
NativeDeviceOrientation方向=NativeDeviceOrientationReader.orientation(上下文);
var四分之一圈=0;
如果(方向==NativeDeviceOrientation.landscapeLeft){
四分之一圈=3;
}else if(方向==NativeDeviceOrientation.landscapeRight){
四分之一圈=1;
}
}
),
(...)
我不知道我是否必须关闭阅读器或其他什么

提前谢谢

--------------编辑1-------------- 实际上我没有解决这个问题,但我可以解决我的问题,将一个
NativeOrientationReader
更改为Flatter
OrientationBuilder
,因为我意识到我不需要当前的旋转,我只想知道手机是横向的还是纵向的

多谢各位