{"id":16401464,"url":"https://github.com/plugfox/platform_info","last_synced_at":"2026-03-07T01:02:39.817Z","repository":{"id":39994722,"uuid":"257871750","full_name":"PlugFox/platform_info","owner":"PlugFox","description":"Contains info about the current platform, such as Build mode and Operating system.","archived":false,"fork":false,"pushed_at":"2024-08-13T14:27:37.000Z","size":1531,"stargazers_count":28,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T11:40:56.420Z","etag":null,"topics":["android","angulardart","cupertino","dart","desktop-device","flutter","fuchsia","ios","linux","mac","macos","web","wtfpl"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/platform_info","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/PlugFox.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":"2020-04-22T10:46:14.000Z","updated_at":"2024-11-20T17:55:48.000Z","dependencies_parsed_at":"2024-08-13T15:35:20.944Z","dependency_job_id":"b2ee6a9d-df07-4333-8ee8-2c0f9d46c93d","html_url":"https://github.com/PlugFox/platform_info","commit_stats":{"total_commits":68,"total_committers":3,"mean_commits":"22.666666666666668","dds":"0.11764705882352944","last_synced_commit":"212156dda6177cd7ec0a780533051a0ad766d6fe"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlugFox%2Fplatform_info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlugFox%2Fplatform_info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlugFox%2Fplatform_info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlugFox%2Fplatform_info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PlugFox","download_url":"https://codeload.github.com/PlugFox/platform_info/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822295,"owners_count":20353499,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["android","angulardart","cupertino","dart","desktop-device","flutter","fuchsia","ios","linux","mac","macos","web","wtfpl"],"created_at":"2024-10-11T05:43:10.007Z","updated_at":"2026-03-07T01:02:39.749Z","avatar_url":"https://github.com/PlugFox.png","language":"Dart","readme":"# platform_info\n\n[![platform_info](https://img.shields.io/pub/v/platform_info.svg)](https://pub.dev/packages/platform_info)\n[![Checkout](https://github.com/PlugFox/platform_info/actions/workflows/checkout.yml/badge.svg)](https://github.com/PlugFox/platform_info/actions/workflows/checkout.yml)\n[![Coverage](https://codecov.io/gh/PlugFox/platform_info/branch/master/graph/badge.svg)](https://codecov.io/gh/PlugFox/platform_info)\n[![License: MIT](https://img.shields.io/badge/license-MIT-purple.svg)](https://opensource.org/licenses/MIT)\n[![Linter](https://img.shields.io/badge/style-linter-40c4ff.svg)](https://pub.dev/packages/linter)\n[![GitHub stars](https://img.shields.io/github/stars/plugfox/platform_info?style=social)](https://github.com/plugfox/platform_info/)\n\n## About\n\nCross-platform io/html package.\nWorks on the web, mobile phones, desktops and console.\nFully caches itself on first initialization.\n\nEasy to use, just add to `pubspec.yaml` as dependency and then import:\n`import 'package:platform_info/platform_info.dart';`\n\nPlatform is a singleton, and the default way to access an instance of Platform is to call static getters:\n`Platform.instance` or `Platform.I` or `platform`\n\n## Usage\n\n![](example.png)\n[Example of using the library](https://pub.dev/packages/platform_info/example) to get the current platform info\n\n## Platform Information\n\nProvides platform information such as:\n\n- Build mode\n\n  - release\n  - profile\n  - debug\n\n- Host platform type\n\n  - vm (io, desktops, mobile, console, server)\n  - js (web, html, browser)\n\n- Operating system\n\n  - Fuchsia\n  - Linux\n  - MacOS\n  - Windows\n  - iOS\n  - Android\n  - Unknown\n\n- Version (`unknown` if not available)\n\n- Locale string (`en` if not available)\n\n- The number of individual execution units of the machine (`0` if not available)\n\n- Operating system is a known type\n\n- Is a Web-based applications\n\n- Is a VM supporting for non-web applications\n\n- Is a mobile device (Android, iOS)\n\n- Is a desktop device (Windows, macOS, Fuchsia)\n\n- Is Material design device (Android, Fuchsia)\n\n- Is Cupertino design device (macOS, iOS)\n\n- is Linux\n\n- is macOS\n\n- is Windows\n\n- is android\n\n- is iOS\n\n- is fuchsia\n\n- `when` method allowing to compose a complex condition\n\n## Pattern matching\n\nRun functions that satisfy the current state of the platform.\nYou can use nested methods to compose more complex queries.\n\n##### Operating System\n\n[fuchsia] - whether the operating system is a version of Fuchsia\n[windows] - whether the operating system is a version of Windows\n[android] - whether the operating system is a version of Android\n[iOS] - whether the operating system is a version of iOS\n[macOS] - whether the operating system is a version of MacOS\n[linux] - whether the operating system is a version of Linux\n[unknown] - operating system unknown\n\n##### Design\n\n[material] - is material (Android, Fuchsia)\n[cupertino] - is cupertino (macOS, iOS)\n\n##### Mobile or desktop\n\n[mobile] - is mobile device (Android, iOS)\n[desktop] - is desktop device (Windows, MacOS, Fuchsia)\n\n##### VM (IO) or JS (Web)\n\n[js] - is web-based applications\n[vm] - is I/O supporting for non-web applications\n\n##### Build mode\n\n[release] - release build mode\n[profile] - profile build mode\n[debug] - debug build mode\n[orElse] - any callback was not called\n\n##### Sequence of checks\n\n1. Operating System\n2. Design\n3. Mobile/Desktop\n4. VM/JS\n5. Build mode\n6. Call [orElse] if any callback was not called\n\n## Coverage\n\n[![](https://codecov.io/gh/PlugFox/platform_info/branch/master/graphs/sunburst.svg)](https://codecov.io/gh/PlugFox/platform_info/branch/master)\n\n## Changelog\n\nRefer to the [Changelog](https://github.com/plugfox/platform_info/blob/master/CHANGELOG.md) to get all release notes.\n\n## Maintainers\n\n[Plague Fox](https://plugfox.dev)\n\n## Funding\n\nIf you want to support the development of our library, there are several ways you can do it:\n\n- [Buy me a coffee](https://www.buymeacoffee.com/plugfox)\n- [Support on Patreon](https://www.patreon.com/plugfox)\n- [Subscribe through Boosty](https://boosty.to/plugfox)\n\nWe appreciate any form of support, whether it's a financial donation or just a star on GitHub. It helps us to continue developing and improving our library. Thank you for your support!\n\n## License\n\n[MIT](https://opensource.org/licenses/MIT)\n\n## Tags\n\ncross, platform, info\n","funding_links":["https://www.buymeacoffee.com/plugfox","https://www.patreon.com/plugfox"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplugfox%2Fplatform_info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplugfox%2Fplatform_info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplugfox%2Fplatform_info/lists"}