orientation_widget 1.1.0 copy "orientation_widget: ^1.1.0" to clipboard
orientation_widget: ^1.1.0 copied to clipboard

A Flutter widget that forces the device rotates into the set of orientations the application interface can be displayed in.

A Flutter widget that forces the device rotates into the set of orientations the application interface can be displayed in.

Features #

Force device keep portrait/landscape or what the set of orientations that you want. Support to reset that config after disposing.

Getting started #

Keep in mind that the widget will only work once in a top-level container. the descendants will not work.

Usage #

Keep portrait orientations

OrientationWidget.portrait(
  child: const PortraitPage(),
)

Keep landscape orientations

OrientationWidget.landscape(
  child: const LandscapePage(),
)

Keep specific orientations

OrientationWidget(
  child: const LandscapeLeftPage(),
  orientations: [DeviceOrientation.landscapeLeft],
)

Then reset to specific orientations, otherwise it allows autoOrientations

OrientationWidget.portrait(
  child: const PortraitPage(),
  then: landscapeOrientations,
),

Additional information #

Feel free to give feedbacks or report issues. Thank you!

3
likes
160
pub points
70%
popularity

Publisher

verified publisherdemen.org

A Flutter widget that forces the device rotates into the set of orientations the application interface can be displayed in.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on orientation_widget