switch_orientation 0.0.1 copy "switch_orientation: ^0.0.1" to clipboard
switch_orientation: ^0.0.1 copied to clipboard

PlatformiOS

A Flutter plugin that switches device orientation.

switch_orientation #

A Flutter plugin that switches device orientation.

☕ Support me #

ko-fi wechat

Chat: Join WeChat group

📦 Installing #

Add switch_orientation to your pubspec.yaml file:

dependencies:
  switch_orientation: latest_version
copied to clipboard

Import switch_orientation in files that it will be used:

import 'package:switch_orientation/switch_orientation.dart';
copied to clipboard

📚 Usage #

iOS #

In AppDelegate

import LXFProtocolTool

func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
    return UIApplication.shared.lxf.currentVcOrientationMask
}
copied to clipboard

Android #

Nothing to do.

Dart #

SwitchOrientation.setPreferredOrientations([
  DeviceOrientation.portraitUp,
  DeviceOrientation.portraitDown,
  DeviceOrientation.landscapeLeft,
  DeviceOrientation.landscapeRight,
]);
copied to clipboard

FAQ #

🖨 About Me #

4
likes
130
points
32
downloads

Publisher

verified publisherfullstackaction.com

Weekly Downloads

2024.07.21 - 2025.02.02

A Flutter plugin that switches device orientation.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on switch_orientation