switch_orientation 0.0.1
switch_orientation: ^0.0.1 copied to clipboard
A Flutter plugin that switches device orientation.
switch_orientation #
A Flutter plugin that switches device orientation.
☕ Support me #
Chat: Join WeChat group
📦 Installing #
Add switch_orientation
to your pubspec.yaml file:
dependencies:
switch_orientation: latest_version
Import switch_orientation
in files that it will be used:
import 'package:switch_orientation/switch_orientation.dart';
📚 Usage #
iOS #
In AppDelegate
import LXFProtocolTool
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
return UIApplication.shared.lxf.currentVcOrientationMask
}
Android #
Nothing to do.
Dart #
SwitchOrientation.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);
FAQ #
- Flutter: Failed to change device orientation on Ipad
- How to enable upside down orientation on flutter for iOS?
🖨 About Me #
- GitHub: https://github.com/LinXunFeng
- Email: linxunfeng@yeah.net
- Blogs:
![](https://github.com/LinXunFeng/LinXunFeng/raw/master/static/img/FSAQR.png)