global_pointer_listener 0.0.1 copy "global_pointer_listener: ^0.0.1" to clipboard
global_pointer_listener: ^0.0.1 copied to clipboard

A widget that listens to global pointer events.

A more idiomatic way to handle global pointer events than adding a global route to the pointerRouter yourself. Simply wrap your widget in GlobalPointerListener, add your callbacks, and you're good to go!

Features #

Listens to global pointer events, in case you don't want to manage complex OverlayEntry objects or add a global pointerRouter route yourself.

Getting started #

Just wrap your widget in GlobalPointerListener and add callbacks for onPointerDown, onPointerUp, onPointerMove, and/or onPointerCancel.

Usage #

Widget build(BuildContext context) {
	return GlobalPointerListener(
		onPointerUp: (_) => print('onPointerUp triggered!'),
		child: Container(
			width: 200,
			height: 200,
			color: Colors.red,
		),
	);
}

Additional information #

Feel free to create a pull request if you have any suggestions or optimizations!

1
likes
130
points
23
downloads

Publisher

verified publisherds797.com

Weekly Downloads

A widget that listens to global pointer events.

Homepage

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

flutter

More

Packages that depend on global_pointer_listener