0

Would like get current status of 'autorotate' system setting in Flutter application. Need to identify weather it is ON or OFF.

This can be done in android with the answer mentioned in the stackoverflow question. Android auto rotate on off status link. But need the same with Flutter which should work for both android and ios.

Apricates your suggestion.

enter image description here

Raghu Mudem
  • 6,793
  • 13
  • 48
  • 69

1 Answers1

0

To know the Orientation of the screen, you can use the OrientationBuilder Widget, it will determine the current Orientation and rebuild when the Orientation changes its state.

@override
Widget build(BuildContext context) {
  return Scaffold(
    body: OrientationBuilder(builder: (_, orientation) {
      if (orientation == Orientation.portrait)
        return Something(); // if orientation is portrait, do something
      else
        return Something(); // else do something 
    }),
  );
}
Aderoju Israel
  • 154
  • 1
  • 11