# fluttertpc_auto_orientation **Repository Path**: openharmony-sig/fluttertpc_auto_orientation ## Basic Information - **Project Name**: fluttertpc_auto_orientation - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 6 - **Created**: 2024-06-25 - **Last Updated**: 2025-05-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 🚨 **重要提示 | IMPORTANT** > > **⚠️ 此代码仓已归档。新地址请访问 [fluttertpc_auto_orientation](https://gitcode.com/openharmony-sig/fluttertpc_auto_orientation)。| ⚠️ This repository has been archived. For the new address, please visit [fluttertpc_auto_orientation](https://gitcode.com/openharmony-sig/fluttertpc_auto_orientation).** > --- > # auto_orientation This plugin was created to programmatically rotate on iOS and Android ## Getting Started After importing the package you can use: `AutoOrientation.landscapeLeftMode();` or `AutoOrientation.landscapeRightMode();` or `AutoOrientation.portraitDownMode();` (might not work) or `AutoOrientation.portraitUpMode();` or `AutoOrientation.portraitAutoMode();` (Android only) or `AutoOrientation.portraitAutoMode(forceSensor: true);` (Use sensor data to change direction, ignoring user's rotation preference. Much like Youtube fullscreen. Android only) or `AutoOrientation.landscapeAutoMode();` (Android only) or `AutoOrientation.landscapeAutoMode(forceSensor: true);` (Use sensor data to change direction, ignoring user's rotation preference. Much like Youtube fullscreen. Android only) or `AutoOrientation.fullAutoMode();` No need to call `SystemChrome.setPreferredOrientations` because it has been added to the library itself. This has been done because before android auto-rotation wasn't working after setting rotation using the plugin. We've used it for a VideoScaffold, to programmatically change to landscape and back to portrait if the scaffold is disposed. ## Example Please have a look in the `example/` folder