move_detector 0.0.2 copy "move_detector: ^0.0.2" to clipboard
move_detector: ^0.0.2 copied to clipboard

The easy way to detect touch movements on screen in Flutter.

Move Detector #

The easy way to detect touch movements on screen in Flutter.

Getting Started #

Add dependency to your project.

$ flutter pub add move_detector

or

dependencies:
  move_detector: ^0.0.2

Then run flutter pub get.

Usage #

Here is a simple way of using MoveDetector.

import 'package:move_detector/move_detector.dart';
MoveDetector(
  child: ..., // your child widget
  onStart: (MoveDetails details) {
    // do something when pointer on screen starting to move
  },
  onUpdate: (MoveDetails details) {
    // do something when pointer on screen is moving
  },
  onEnd: (MoveDetails details) {
    // do something when pointer on screen stop moving
  },
)

And here is the details of each MoveDetails.

// Coordinate of the position of the pointer, 
// in logical pixels in the global coordinate space.
Offset position 

// The [position] transformed into the local coordinate system.
Offset localPosition

// Distance in logical pixels that the pointer has moved since the last [MoveEvent].
Offset delta

// The [delta] transformed into the local coordinate system.
Offset localDelta

Example #

Check out example project here. You can also try the working example app: move_detector.apk.

7
likes
140
pub points
35%
popularity

Publisher

unverified uploader

The easy way to detect touch movements on screen in Flutter.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on move_detector