पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

पैकेज विवरणv0.0.4

flutter_custom_cursor

मेमोरी बफर से सीधे कस्टम माउस कर्सर बनाएं / सेट करें।

macOSWindowsLinux
30-दिन डाउनलोड
54.2 हज़ार
लाइक
19
Pub अंक
140

पैकेज इंस्टॉल करें

flutter pub add flutter_custom_cursor

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

एक फ्लटर पैकेज जो डेस्कटॉप प्लेटफॉर्म पर मेमोरी बफर का उपयोग करके विकासकर्ताओं को कस्टम माउस कर्सर सेट करने की अनुमति देता है। यह कर्सर के रूप को सटीक नियंत्रित करने की अनुमति देता है, क्योंकि कर्सर डेटा सीधे मेमोरी से लोड किया जाता है, जो अद्वितीय या डायनामिक कर्सर डिज़ाइन की आवश्यकता वाले एप्लिकेशन के लिए आदर्श है। यह पैकेज विशेष रूप से Windows, Linux और macOS के लिए तैयार किया गया है, जो फ्लटर के डेस्कटॉप लक्ष्यों के साथ बिना किसी दिक्कत के एकीकरण प्रदान करता है। यह बाहरी फाइलों पर निर्भर नहीं करते हुए उन्नत कर्सर कस्टमाइजेशन को समर्थन देता है, जिससे UI डिज़ाइन में प्रदर्शन और लचीलापन में सुधार होता है।

उपयोग

  • गेम्स में कस्टम कर्सर
  • इंटरैक्टिव यूआई तत्व
  • डेस्कटॉप एप्लिकेशन ब्रांडिंग
  • डायनामिक कर्सर बदलाव
  • उच्च प्रदर्शन घूमते सूचक रेंडरिंग
  • प्राप्ति सुविधाएँ

मुख्य विशेषताएँ

  • प्रत्यक्ष मेमोरी बफर इनपुट
  • क्रॉस-प्लेटफॉर्म डेस्कटॉप समर्थन
  • बाहरी फ़ाइल निर्भरता नहीं
  • उच्च प्रदर्शन
  • Flutter के साथ आसान एकीकरण
  • एनिमेटेड कर्सर का समर्थन करता है

इनके लिए उपयुक्त

  • डेस्कटॉप ऐप विकासकर्ता
  • गेम विकासकर्ता
  • UI/UX डिजाइनर
  • अद्वितीय कर्सर व्यवहार की आवश्यकता वाले अनुप्रयोग
  • प्रदर्शन-संवेदनशील परियोजनाएँ

विचार योग्य बातें

  • डेस्कटॉप प्लेटफॉर्म तक सीमित
  • प्लेटफॉर्म-विशिष्ट कार्यान्वयन ज्ञान की आवश्यकता होती है
  • कर्सर बफ़र के लिए मेमोरी प्रबंधन
  • मोबाइल ऐप्स के लिए उपयुक्त नहीं
  • कर्सर के आकार और प्रारूप सीमाएँ
  • कुछ ओएस संस्करणों के साथ संगतता समस्याएँ हो सकती हैं

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

flutter_custom_cursor

This plugin allows to create/set a custom mouse cursor directly from a memory buffer.

Big thanks to imiskolee to create the base of this plugin.

Platforms

  • [x] macOS
  • [x] Windows
  • [x] Linux

Note: Currently, the api required by this plugin on Windows is included in flutter master branch. It means that u need to use this plugin with flutter master branch on Windows platform. See flutter engine PR#36143 for details.

Update: the latest Flutter 3.7.0 does not contain PR above, which merges to flutter-3.7.0-candidate.2, while Flutter stable 3.7.0 is using flutter-3.7.0-candidate.1. This limitation will be lifted maybe in the next Flutter stable release.

Get prepared

Register your custom cursor before

// register this cursor
cursorName = await CursorManager.instance.registerCursor(CursorData()
  ..name = "test"
  ..buffer =
      Platform.isWindows ? memoryCursorDataRawBGRA : memoryCursorDataRawPNG
  ..height = img.height
  ..width = img.width
  ..hotX = 0
  ..hotY = 0);

Note that a String cacheName will be returned by the function registerCursor, which can be used to set this cursor to system or delete this cursor.

CursorData.buffer is a Uint8List which contains the cursor data. Be aware that on Windows, buffer is formatted by rawBGRA, other OS(s) are rawPNG.

see the example project for details.

Set the custom cursor

We have implemented the FlutterCustomMemoryImageCursor class, which is a subclass of MouseCursor. This class will automatically set the memory cursor for you. Keep it simple.

MouseRegion(
  cursor: FlutterCustomMemoryImageCursor(key: cursorName),
  child: Row(
    children: [
      Text("Memory image here", style: style),
    ],
  ),
),

Delete the cursor

You can delete a cursor with the cursorName.

await CursorManager.instance.deleteCursor("cursorName");

श्रेणियाँ

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट