screen_retriever
इस प्लगइन के द्वारा Flutter डेस्कटॉप ऐप्स स्क्रीन के आकार, डिस्प्ले, कर्सर स्थिति आदि के बारे में जानकारी प्राप्त कर सकते हैं।
इस प्लगइन के द्वारा Flutter डेस्कटॉप ऐप्स स्क्रीन के आकार, डिस्प्ले, कर्सर स्थिति आदि के बारे में जानकारी प्राप्त कर सकते हैं।
यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
⚠️ Migration Notice: This plugin is being migrated to libnativeapi/nativeapi-flutter
The new version is based on a unified C++ core library (libnativeapi/nativeapi), providing more complete and consistent cross-platform native API support. r
This plugin allows Flutter desktop apps to Retrieve information about screen size, displays, cursor position, etc.
English | 简体中文
| Linux | macOS | Windows |
|---|---|---|
| ✔️ | ✔️ | ✔️ |
Add this to your package's pubspec.yaml file:
dependencies:
screen_retriever: ^0.2.0
Or
dependencies:
screen_retriever:
git:
url: https://github.com/leanflutter/screen_retriever.git
path: packages/screen_retriever
ref: main
Display? _primaryDisplay;
List<Display> _displayList = [];
void _init() async {
_primaryDisplay = await screenRetriever.getPrimaryDisplay();
_displayList = await screenRetriever.getAllDisplays();
setState(() {});
}
class HomePage extends StatefulWidget {
const HomePage({Key? key}) : super(key: key);
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> with ScreenListener {
@override
void initState() {
screenRetriever.addListener(this);
super.initState();
}
@override
void dispose() {
screenRetriever.removeListener(this);
super.dispose();
}
@override
Widget build(BuildContext context) {
// ...
}
@override
void onScreenEvent(String eventName) {
String log = 'Event received: $eventName)';
print(log);
}
}
Please see the example app of this plugin for a full example.
| Method | Description | Linux | macOS | Windows |
|---|---|---|---|---|
getCursorScreenPoint |
Returns Offset - The current absolute position of the mouse pointer. |
✔️ | ✔️ | ✔️ |
getPrimaryDisplay |
Returns Display - The primary display. |
✔️ | ✔️ | ✔️ |
getAllDisplays |
Returns List<Display> - An array of displays that are currently available. |
✔️ | ✔️ | ✔️ |
Thanks goes to these wonderful people (emoji key):
LiJianying 💻 |
Christian Padilla 💻 |
J-P Nurmi 💻 |
Kingtous 💻 |
fufesou 💻 |
lukasz-lukasz-lukasz 💻 |
|
|
|
||||||
This project follows the all-contributors specification. Contributions of any kind welcome!
निर्भरता सूची 1 आइटम
^6.1.0उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗