orientation static method

NativeDeviceOrientation orientation(
  1. BuildContext context
)

Implementation

static NativeDeviceOrientation orientation(BuildContext context) {
  final inheritedNativeOrientation = context.dependOnInheritedWidgetOfExactType<_InheritedNativeDeviceOrientation>();

  assert(() {
    if (inheritedNativeOrientation == null) {
      throw FlutterError('DeviceOrientationListener.orientation was called but there'
          ' is no DeviceOrientationListener in the context.');
    }
    return true;
  }());

  return inheritedNativeOrientation!.nativeOrientation;
}