Skip to content

mpcreza/device_auto_rotate_checker

Repository files navigation

device_auto_rotate_checker

A flutter plugin to check if device auto rotate is on or off.

Note: This plugin only supports Android. there is no way to check auto rotate on iOS.

Usage

Example:

import 'package:device_auto_rotate_checker/device_auto_rotate_checker.dart';

bool autoRotate = await DeviceAutoRotateChecker.checkAutoRotate();

Listen to the device's auto rotate settings change:

import 'package:device_auto_rotate_checker/device_auto_rotate_checker.dart';

DeviceAutoRotateChecker.autoRotateStream.listen((bool autoRotate) {
  print('auto rotate is: $autoRotate');
});