flutter_custom_cursor
0.0.4, released 4 years ago by kingtous.cn
Create and set custom mouse cursors directly from a memory buffer on desktop platforms.
What it does
Allows developers to register and set custom mouse cursors dynamically using raw memory buffers (PNG or raw BGRA). It integrates with Flutter's MouseRegion via a custom MouseCursor subclass.
AI-written summary of version 0.0.4, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are building a desktop application for macOS, Windows, or Linux.
- You need to create custom mouse cursors dynamically from image memory buffers.
Skip it when
- You are targeting mobile or web platforms.
- You only need standard system cursors provided by Flutter.
Strengths
- Enables dynamic custom cursors from raw memory buffers.
- Provides a simple wrapper subclass of MouseCursor for easy integration.
Weaknesses
- Limited platform support to desktop operating systems (macOS, Windows, Linux).
- Windows platform may have specific Flutter engine branch or version requirements depending on the engine PR status.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Requires registering the cursor data using CursorManager before applying it to a MouseRegion.
cursorName = await CursorManager.instance.registerCursor(CursorData()
..name = "test"
..buffer = memoryCursorDataRawPNG
..height = img.height
..width = img.width
..hotX = 0
..hotY = 0);
MouseRegion(
cursor: FlutterCustomMemoryImageCursor(key: cursorName),
child: Text("Custom cursor region"),
)