Skip to content
pubscout

auto_orientation_v2

2.4.7, released 6 weeks ago by rizkyghofur.my.id

Programmatically control device orientation on iOS, Android, and Web.

WASM-ready
$ flutter pub add auto_orientation_v2
Source repository

What it does

Allows Flutter apps to programmatically switch between portrait, landscape, and auto rotation modes on iOS, Android, and Web. It includes helper getters for checking orientation and a declarative AutoOrientationScope widget for automatic locking and reverting.

AI-written summary of version 2.4.7, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are building a video player that needs to switch to landscape in fullscreen.
  • You are creating a game or reading app requiring specific forced orientations.

Skip it when

  • You prefer manually invoking SystemChrome.setPreferredOrientations exclusively.

Strengths

  • Supports forceSensor on Android to override user rotation settings.
  • Provides a declarative AutoOrientationScope widget.
  • Includes orientation helper getters like isLandscape and isPortrait.

Weaknesses

  • Some portrait down modes may not function properly on all devices.

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
1

Add the dependency to pubspec.yaml and import the package. Do not manually call SystemChrome.setPreferredOrientations.

AutoOrientation.landscapeRightMode();

Alternatives

Packages that do the same job and could replace auto_orientation_v2.

Works with

Packages commonly used together with auto_orientation_v2: ones it builds on, ones built on it, and its own family.