nes_ui_desktop_cursor 0.2.0 copy "nes_ui_desktop_cursor: ^0.2.0" to clipboard
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 #

style: very good analysis Powered by Mason License: MIT

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: ...
),
1
likes
160
points
59
downloads

Publisher

unverified uploader

Weekly Downloads

A flutter package that allows Nes UI Icon's to be used a mouse cursor on desktop

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flame_mini_sprite, flutter, flutter_custom_cursor, image, nes_ui, uuid

More

Packages that depend on nes_ui_desktop_cursor