forked from UnityTech/UIWidgets
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLongPressSample.cs
More file actions
45 lines (41 loc) · 1.43 KB
/
LongPressSample.cs
File metadata and controls
45 lines (41 loc) · 1.43 KB
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
using Unity.UIWidgets.animation;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.material;
using Unity.UIWidgets.widgets;
using UnityEngine;
namespace UIWidgetsSample {
public class LongPressSample: UIWidgetsSamplePanel {
protected override Widget createWidget() {
return new WidgetsApp(
home: new LongPressSampleWidget(),
pageRouteBuilder: this.pageRouteBuilder);
}
}
public class LongPressSampleWidget: StatefulWidget {
public override State createState() {
return new _LongPressSampleWidgetState();
}
}
class _LongPressSampleWidgetState : State<LongPressSampleWidget> {
public override Widget build(BuildContext context) {
return new GestureDetector(
onLongPressDragStart: (value) => {
Debug.Log($"Long Press Drag Start: {value}");
},
onLongPressDragUpdate: (value) => {
Debug.Log($"Long Press Drag Update: {value}");
},
onLongPressDragUp: (value) => {
Debug.Log($"Long Press Drag Up: {value}");
},
child: new Center(
child: new Container(
width: 200,
height: 200,
color: Colors.blue
)
)
);
}
}
}