-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGestureBox.dart
54 lines (41 loc) · 946 Bytes
/
GestureBox.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class GestureBox extends StatefulWidget {
final Function onClick;
final Function onPress;
final Function onLeave;
final Widget child;
GestureBox({
@required this.child,
this.onClick,
this.onPress,
this.onLeave
});
@override
_GestureBox createState () => new _GestureBox();
}
class _GestureBox extends State<GestureBox> {
@override
Widget build (BuildContext context) {
return Listener(
onPointerDown: (down) {
print("onPointerDownEvent");
},
onPointerMove: (move) {
print("onPointerMove");
},
onPointerUp: (up) {
print("onPointerUp");
},
onPointerCancel: (cancle){
print("onPointerCancel");
},
child: Center(
child: Text(
"test",
textDirection: TextDirection.ltr,
),
),
);
}
}