सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
प्लेटफॉर्म_इन्फो पैकेज वर्तमान निष्पादन वातावरण के विस्तृत जानकारी तक आसान पहुंच प्रदान करता है, जिसमें बिल्ड मोड (डिबग, रिलीज, प्रोफाइल) और ऑपरेटिंग सिस्टम शामिल है। यह डेवलपर्स के लिए डिज़ाइन किया गया है जो प्लेटफॉर्म-विशिष्ट विशेषताओं के आधार पर कोड को शर्त के आधार पर निष्पादित करना चाहते हैं। यह सभी प्रमुख प्लेटफॉर्म: Android, iOS, Web, macOS, Windows और Linux का समर्थन करता है, जिससे यह क्रॉस-प्लेटफॉर्म एप्लिकेशन के लिए आदर्श बन जाता है जिसमें रनटाइम प्लेटफॉर्म जागरूकता की आवश्यकता होती है। यह जटिल तर्क या नेटिव कोड के बिना प्लेटफॉर्म विवरण का पता लगाने के लिए हल्का और सीधा API प्रदान करता है।
उपयोग
बिल्ड मोड पर आधारित शर्त तर्क
समय पर संचालन प्रणाली का पता लगाना
क्रॉस-प्लेटफॉर्म एप्लिकेशन कस्टमाइज़ेशन
रनटाइम प्लेटफॉर्म निदान
प्लेटफॉर्म के अनुसार फीचर फ्लैगिंग
प्लेटफॉर्म-विशिष्ट समस्याओं का निराकरण
मुख्य विशेषताएँ
सभी प्रमुख प्लेटफॉर्म का समर्थन करता है
बिल्ड मोड निर्धारण प्रदान करता है
सरल और स्पष्ट एपीआई
हल्का और निर्भरता-मुक्त
रियल-टाइम प्लेटफॉर्म जानकारी
मूल कोड की आवश्यकता नहीं है
इनके लिए उपयुक्त
क्रॉस-प्लेटफ़ॉर्म फ्लटर एप्प्स
बिल्ड मोड चेक की आवश्यकता वाले ऐप्स
बहुओएस लक्षित विकासकर्ता
परीक्षण और डिबगिंग परिदृश्य
प्लेटफॉर्म-विशिष्ट विशेषताओं वाले ऐप्स
विचार योग्य बातें
हार्डवेयर स्तरीय विवरण प्रदान नहीं करता है
मूलभाग प्लेटफॉर्म और बिल्ड जानकारी तक सीमित
उन्नत उपकरण निर्धारण के लिए अनुपयुक्त
किनारे के मामलों का हस्तक्षेप आवश्यक है
प्रारंभ के बाद कोई रनटाइम अपडेट नहीं
विशिष्ट डिवाइस मॉडल का समर्थन नहीं है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
platform_info
About
Cross-platform io/html package.
Works on the web, mobile phones, desktops and console.
Fully caches itself on first initialization.
Easy to use, just add to pubspec.yaml as dependency and then import:
import 'package:platform_info/platform_info.dart';
Platform is a singleton, and the default way to access an instance of Platform is to call static getters:
Platform.instance or Platform.I or platform
The number of individual execution units of the machine (0 if not available)
Operating system is a known type
Is a Web-based applications
Is a VM supporting for non-web applications
Is a mobile device (Android, iOS)
Is a desktop device (Windows, macOS, Fuchsia)
Is Material design device (Android, Fuchsia)
Is Cupertino design device (macOS, iOS)
is Linux
is macOS
is Windows
is android
is iOS
is fuchsia
when method allowing to compose a complex condition
Pattern matching
Run functions that satisfy the current state of the platform.
You can use nested methods to compose more complex queries.
Operating System
[fuchsia] - whether the operating system is a version of Fuchsia
[windows] - whether the operating system is a version of Windows
[android] - whether the operating system is a version of Android
[iOS] - whether the operating system is a version of iOS
[macOS] - whether the operating system is a version of MacOS
[linux] - whether the operating system is a version of Linux
[unknown] - operating system unknown
Design
[material] - is material (Android, Fuchsia)
[cupertino] - is cupertino (macOS, iOS)
Mobile or desktop
[mobile] - is mobile device (Android, iOS)
[desktop] - is desktop device (Windows, MacOS, Fuchsia)
VM (IO) or JS (Web)
[js] - is web-based applications
[vm] - is I/O supporting for non-web applications
Build mode
[release] - release build mode
[profile] - profile build mode
[debug] - debug build mode
[orElse] - any callback was not called
We 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!