{"id":22908387,"url":"https://github.com/mohamedmagdy2301/lock_orientation_screen","last_synced_at":"2026-02-11T12:06:30.799Z","repository":{"id":267878216,"uuid":"902628435","full_name":"mohamedmagdy2301/lock_orientation_screen","owner":"mohamedmagdy2301","description":"A Flutter package to lock the screen orientation to portrait mode and restore default orientations when disposed.","archived":false,"fork":false,"pushed_at":"2024-12-13T01:26:55.000Z","size":13,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-18T09:18:06.468Z","etag":null,"topics":["dart","flutter","flutter-package","flutter-packages","landscape","lock-landscape","lock-orientation","orientation","package","packages","portrait"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/lock_orientation_screen","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mohamedmagdy2301.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-13T00:18:22.000Z","updated_at":"2025-01-23T21:51:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"4cedffe6-52b4-4ad1-b8d0-82e3e60f79a8","html_url":"https://github.com/mohamedmagdy2301/lock_orientation_screen","commit_stats":null,"previous_names":["mohamedmagdy2301/lock_orientation_screen"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mohamedmagdy2301/lock_orientation_screen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohamedmagdy2301%2Flock_orientation_screen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohamedmagdy2301%2Flock_orientation_screen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohamedmagdy2301%2Flock_orientation_screen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohamedmagdy2301%2Flock_orientation_screen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohamedmagdy2301","download_url":"https://codeload.github.com/mohamedmagdy2301/lock_orientation_screen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohamedmagdy2301%2Flock_orientation_screen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29332717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T06:13:03.264Z","status":"ssl_error","status_checked_at":"2026-02-11T06:12:55.843Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","flutter","flutter-package","flutter-packages","landscape","lock-landscape","lock-orientation","orientation","package","packages","portrait"],"created_at":"2024-12-14T03:29:00.416Z","updated_at":"2026-02-11T12:06:30.783Z","avatar_url":"https://github.com/mohamedmagdy2301.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lock Orientation\n\n**Lock Orientation Screen** is a Flutter package designed to help developers easily lock the screen orientation to portrait mode within their applications. This package simplifies the process by managing the system's orientation settings seamlessly.\n\n---\n\n## Features\n\n- Locks the screen orientation to portrait mode.\n- Restores the default system orientations when disposed.\n- Easy to integrate and use.\n\n---\n\n## Installation\n\nAdd the following line to your project's `pubspec.yaml` under `dependencies`:\n\n```yaml\ndependencies:\n  lock_orientation_screen: ^0.0.4\n```\n\nThen, run:\n\n```bash\nflutter pub get\n```\n\n---\n\n## Usage\n\nWrap your app or specific widgets with `LockOrientation` to lock the orientation to portrait mode.\n\n### Example:\n\n```dart\nimport 'package:lock_orientation/lock_orientation.dart';\nimport 'package:flutter/material.dart';\n\nvoid main() {\n  runApp(const MyApp());\n}\n\nclass MyApp extends StatelessWidget {\n  const MyApp({super.key});\n\n  @override\n  Widget build(BuildContext context) {\n    return LockOrientation(\n      child: MaterialApp(\n        home: Scaffold(\n          appBar: AppBar(title: const Text('Lock Orientation Example')),\n          body: const Center(\n            child: Text('Portrait Mode Only'),\n          ),\n        ),\n      ),\n    );\n  }\n}\n```\n\n---\n\n## API\n\n### `LockOrientation`\n\n#### Constructor\n```dart\nconst LockOrientation({required Widget child, Key? key})\n```\n- **`child`**: The widget to display within the locked orientation.\n- **`key`**: An optional key for the widget.\n\n#### Behavior\n- Locks the orientation to portrait when initialized.\n- Restores default orientations when disposed.\n\n---\n\n## How It Works\n\n`LockOrientation` uses Flutter's `SystemChrome.setPreferredOrientations` to control screen orientation:\n- **On initialization:** Sets orientation to `portraitUp` and `portraitDown`.\n- **On disposal:** Restores all orientations (`portraitUp`, `portraitDown`, `landscapeLeft`, `landscapeRight`).\n\n---\n## Contributing\n\nContributions are highly encouraged! If you would like to contribute to `LockOrientation`, please follow these steps:\n\n1. **Fork the Repository**.\n2. **Create a New Branch**:\n   ```bash\n   git checkout -b feature/YourFeature\n   ```\n3. **Commit Your Changes**:\n   ```bash\n   git commit -m \"Add your message\"\n   ```\n4. **Push to the Branch**:\n   ```bash\n   git push origin feature/YourFeature\n   ```\n5. **Open a Pull Request**.\n\n## Congratulations\n\n\nContributions are welcome! If you find a bug or have a feature request, please open an issue or submit a pull request in the [GitHub repository](https://github.com/mohamedmagdy2301/lock_orientation_screen)\n\nIf you found this guide helpful, don’t forget to ⭐ star this repository on GitHub to show your support!\n\nThank you for reading!\n\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Contact\n\nFor any questions or inquiries, feel free to reach out:\n\n- **GitHub:** [mohamedmagdy2301](https://github.com/mohamedmagdy2301)\n- **Email:** [mohammedmego15@gmail.com](mohammedmego15@gmail.com)\n\n\n\n---\n\nThank you for using **Lock Orientation**!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohamedmagdy2301%2Flock_orientation_screen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohamedmagdy2301%2Flock_orientation_screen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohamedmagdy2301%2Flock_orientation_screen/lists"}