How could I figure out if the user has the device in portrait or landscape mode with accelerometer data?

I tried like this:

  var accListener = accelerometerEvents.listen((AccelerometerEvent event) {

And I get the correct data. But if I try to check the values for portrait and landscape mode, I get almost the same values.

Here the console output:


[AccelerometerEvent (x: 0.30221252441406254, y: -0.14819030761718752, z: 9.999481201171875)]


[AccelerometerEvent (x: -0.10826416015625001, y: -0.45100097656250004, z: 9.979293823242188)]

There is a small difference for x and y because of the tilt, but in general I have similar values...

Is there a possibility to get this information? Or maybe with other sensor data?