nes_ui_desktop_cursor 0.2.0
nes_ui_desktop_cursor: ^0.2.0 copied to clipboard
A flutter package that allows Nes UI Icon's to be used a mouse cursor on desktop
Nes Ui Desktop Cursor #
A flutter package that allows Nes UI Icon's to be used a mouse cursor on desktop
Installation 💻 #
❗ In order to start using Nes Ui Desktop Cursor you must have the Flutter SDK installed on your machine.
Install via flutter pub add
:
dart pub add nes_ui_desktop_cursor
How to use it #
Before you can use a NesIconData
as a cursor, they need to be registered in the
NesUIDesktopCursor
instance.
To do so:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
const pixelSize = 4.0;
const palette = [
Colors.black,
Colors.white,
];
await NesUIDesktopCursor.instance.addCursor(
NesIcons.arrowCursor,
pixelSize: pixelSize,
palette: palette,
);
}
Or multiple cursors can be registered with addMultipleCursors
:
await NesUIDesktopCursor.instance.addMultipleCursors(
icons: [
NesIcons.arrowCursor,
NesIcons.leftHand,
NesIcons.axe,
NesIcons.check,
],
pixelSize: pixelSize,
palette: palette,
);
Then to use the registered cursors, the Flutter MouseRegion
widget can be used:
MouseRegion(
cursor: NesUIDesktopCursor.instance.getNesCursor(
NesIcons.leftHand,
),
child: ...
),